1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-10-04 17:41:42 +02:00

Store QPixmap on the heap in Result, as it's created in a db thread

This commit is contained in:
Leo Franchi
2012-09-14 15:40:58 -04:00
parent 06b1541f85
commit 8e73e52986
4 changed files with 14 additions and 6 deletions

View File

@@ -64,6 +64,7 @@ Result::isCached( const QString& url )
Result::Result( const QString& url )
: QObject()
, m_url( url )
, m_sourceIcon( 0 )
, m_duration( 0 )
, m_bitrate( 0 )
, m_size( 0 )
@@ -81,6 +82,7 @@ Result::Result( const QString& url )
Result::~Result()
{
delete m_sourceIcon;
}
@@ -301,7 +303,10 @@ Result::sourceIcon() const
{
if ( collection().isNull() )
{
return m_sourceIcon;
if ( !m_sourceIcon )
return QPixmap();
else
return *m_sourceIcon;
}
else
{