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

Make sure m_artistsFilterCmd doesn't leak in TreeProxyModel.

This commit is contained in:
Christian Muehlhaeuser
2015-04-13 02:12:58 +02:00
parent aab9b28bdf
commit 8370e4b72f

View File

@@ -114,6 +114,7 @@ TreeProxyModel::setFilter( const QString& pattern )
disconnect( dynamic_cast< QObject* >( m_artistsFilterCmd ), SIGNAL( artists( QList<Tomahawk::artist_ptr> ) ), disconnect( dynamic_cast< QObject* >( m_artistsFilterCmd ), SIGNAL( artists( QList<Tomahawk::artist_ptr> ) ),
this, SLOT( onFilterArtists( QList<Tomahawk::artist_ptr> ) ) ); this, SLOT( onFilterArtists( QList<Tomahawk::artist_ptr> ) ) );
delete m_artistsFilterCmd;
m_artistsFilterCmd = 0; m_artistsFilterCmd = 0;
} }
@@ -190,7 +191,14 @@ TreeProxyModel::onFilterAlbums( const QList<Tomahawk::album_ptr>& albums )
void void
TreeProxyModel::filterFinished() TreeProxyModel::filterFinished()
{ {
if ( m_artistsFilterCmd )
{
disconnect( dynamic_cast< QObject* >( m_artistsFilterCmd ), SIGNAL( artists( QList<Tomahawk::artist_ptr> ) ),
this, SLOT( onFilterArtists( QList<Tomahawk::artist_ptr> ) ) );
delete m_artistsFilterCmd;
m_artistsFilterCmd = 0; m_artistsFilterCmd = 0;
}
setFilterRegExp( m_filter ); setFilterRegExp( m_filter );
emit filterChanged( m_filter ); emit filterChanged( m_filter );