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

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)
void Watched::removeObserver(PlaylistObserver *observer)
{
m_observers.remove(observer);
if(observer)
observer->clearWatched();
m_observers.removeAll(observer);
}
void Watched::clearObservers()
{
foreach(PlaylistObserver *observer, m_observers)
observer->clearWatched();
m_observers.clear();
}
Watched::~Watched()
{
foreach(PlaylistObserver *observer, m_observers)
observer->clearWatched();
clearObservers();
}
////////////////////////////////////////////////////////////////////////////////
......
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