1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-22 13:43:11 +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 2ce66e2830
commit 8858272e06

View File

@@ -114,6 +114,7 @@ TreeProxyModel::setFilter( const QString& pattern )
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;
}
@@ -190,7 +191,14 @@ TreeProxyModel::onFilterAlbums( const QList<Tomahawk::album_ptr>& albums )
void
TreeProxyModel::filterFinished()
{
m_artistsFilterCmd = 0;
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;
}
setFilterRegExp( m_filter );
emit filterChanged( m_filter );