Commit 9f6b892d authored by Michael Pyne's avatar Michael Pyne
Browse files

Apply patch from Jiri Palecek to fix a fairly common source of JuK crashers, fix

will be in KDE 4.3 (backporting to 4.2.3).

CCBUG:179776

svn path=/trunk/KDE/kdemultimedia/juk/; revision=960742
parent 73e5240b
...@@ -37,18 +37,23 @@ void Watched::addObserver(PlaylistObserver *observer) ...@@ -37,18 +37,23 @@ void Watched::addObserver(PlaylistObserver *observer)
void Watched::removeObserver(PlaylistObserver *observer) void Watched::removeObserver(PlaylistObserver *observer)
{ {
m_observers.remove(observer); if(observer)
observer->clearWatched();
m_observers.removeAll(observer);
} }
void Watched::clearObservers() void Watched::clearObservers()
{ {
foreach(PlaylistObserver *observer, m_observers)
observer->clearWatched();
m_observers.clear(); m_observers.clear();
} }
Watched::~Watched() Watched::~Watched()
{ {
foreach(PlaylistObserver *observer, m_observers) clearObservers();
observer->clearWatched();
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment