diff --git a/src/libtomahawk/playlist/PlaylistUpdaterInterface.cpp b/src/libtomahawk/playlist/PlaylistUpdaterInterface.cpp index 700001227..e5eb35d6d 100644 --- a/src/libtomahawk/playlist/PlaylistUpdaterInterface.cpp +++ b/src/libtomahawk/playlist/PlaylistUpdaterInterface.cpp @@ -70,6 +70,13 @@ PlaylistUpdaterInterface::PlaylistUpdaterInterface( const playlist_ptr& pl ) } +PlaylistUpdaterInterface::~PlaylistUpdaterInterface() +{ + if ( !m_playlist.isNull() ) + m_playlist->removeUpdater( this ); +} + + void PlaylistUpdaterInterface::save() { diff --git a/src/libtomahawk/playlist/PlaylistUpdaterInterface.h b/src/libtomahawk/playlist/PlaylistUpdaterInterface.h index 6ea530a2a..3cdac7397 100644 --- a/src/libtomahawk/playlist/PlaylistUpdaterInterface.h +++ b/src/libtomahawk/playlist/PlaylistUpdaterInterface.h @@ -56,7 +56,7 @@ public: explicit PlaylistUpdaterInterface( const playlist_ptr& pl ); - virtual ~PlaylistUpdaterInterface(){} + virtual ~PlaylistUpdaterInterface(); // What type you are. If you add a new updater, add the creation code as well. virtual QString type() const = 0;