From 8370e4b72fe364ade78fb9ef17f7466dab7cec36 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 13 Apr 2015 02:12:58 +0200 Subject: [PATCH] Make sure m_artistsFilterCmd doesn't leak in TreeProxyModel. --- src/libtomahawk/playlist/TreeProxyModel.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/playlist/TreeProxyModel.cpp b/src/libtomahawk/playlist/TreeProxyModel.cpp index 9f4817668..ffef3be2d 100644 --- a/src/libtomahawk/playlist/TreeProxyModel.cpp +++ b/src/libtomahawk/playlist/TreeProxyModel.cpp @@ -114,6 +114,7 @@ TreeProxyModel::setFilter( const QString& pattern ) disconnect( dynamic_cast< QObject* >( m_artistsFilterCmd ), SIGNAL( artists( QList ) ), this, SLOT( onFilterArtists( QList ) ) ); + delete m_artistsFilterCmd; m_artistsFilterCmd = 0; } @@ -190,7 +191,14 @@ TreeProxyModel::onFilterAlbums( const QList& albums ) void TreeProxyModel::filterFinished() { - m_artistsFilterCmd = 0; + if ( m_artistsFilterCmd ) + { + disconnect( dynamic_cast< QObject* >( m_artistsFilterCmd ), SIGNAL( artists( QList ) ), + this, SLOT( onFilterArtists( QList ) ) ); + + delete m_artistsFilterCmd; + m_artistsFilterCmd = 0; + } setFilterRegExp( m_filter ); emit filterChanged( m_filter );