1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-04 13:17:34 +02:00

* Don't leak memory when setting new avatar on a Source.

This commit is contained in:
Christian Muehlhaeuser
2011-05-12 15:53:31 +02:00
parent 853c0a0170
commit 04cbc78ff7
2 changed files with 4 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
Version 0.1.0: Version 0.1.0:
* Fix issue where track resolving spinner never stopped if tracks were * Fix issue where track resolving spinner never stopped if tracks were
removed from playlist while resolving. removed from playlist while resolving.
* Fix issues with stations where multiple tracks could be added at once * Fix issues with stations where multiple tracks could be added at once.
* Allow multiple accounts of the same type. * Allow multiple accounts of the same type.
* Add new Google account type that is a thin wrapper around a Jabber plugin. * Add new Google account type that is a thin wrapper around a Jabber plugin.
* Overhaul the settings dialog interface. * Overhaul the settings dialog interface.

View File

@@ -117,7 +117,8 @@ Source::friendlyName() const
void void
Source::setAvatar( const QPixmap& avatar ) Source::setAvatar( const QPixmap& avatar )
{ {
//HACK: we should really properly make sure that only the GUI thread ever accesses this function //FIXME: use a proper pixmap store that's thread-safe
delete m_avatar;
m_avatar = new QPixmap( avatar ); m_avatar = new QPixmap( avatar );
} }
@@ -125,7 +126,7 @@ Source::setAvatar( const QPixmap& avatar )
QPixmap QPixmap
Source::avatar() const Source::avatar() const
{ {
//HACK: we should really properly make sure that only the GUI thread ever accesses this function //FIXME: use a proper pixmap store that's thread-safe
if ( m_avatar ) if ( m_avatar )
return QPixmap( *m_avatar ); return QPixmap( *m_avatar );
else else