From kde-commits Sat Jun 11 07:06:28 2011 From: Giorgos Kylafas Date: Sat, 11 Jun 2011 07:06:28 +0000 To: kde-commits Subject: KDE/kdemultimedia/juk Message-Id: <20110611070628.1D3B5AC7BC () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=130777692513180 SVN commit 1236082 by kylafas: juk: no crash-on-exit while playing, no matter how we exit. Since r921339, we stop the playback during exit, otherwise some phonon backends will crash. However, the relevant code was only executed when selecting "File->Quit", not when closing the window nor when quitting from the system tray. So, similarly to r1236077, put the stopping of playback into queryExit() to get executed in every case. Being in queryExit() means quit() has already been called. So, we can no longer wait for Phonon's StoppedState and then call quit(), as was done in r921339. However, waiting for Phonon's state change does not seem to be necessary any more, so we can safely remove slotPlaybackStopped(). M +5 -12 juk.cpp M +0 -1 juk.h --- trunk/KDE/kdemultimedia/juk/juk.cpp #1236081:1236082 @@ -486,6 +486,11 @@ // supposed to do end of execution destruction yet anyways, use // slotAboutToQuit for that. + // Some phonon backends will crash on shutdown unless we've stopped + // playback. + if(m_player->playing()) + m_player->stop(); + // Save configuration data. m_startDocked = !isVisible(); saveConfig(); @@ -539,18 +544,6 @@ { m_shuttingDown = true; - // Some phonon backends will crash on shutdown unless we're deep in the middle of the StoppedState. - // So have the PlayerManager tell us when we're stopped and we'll continue. - if(m_player->playing()) { - connect(m_player, SIGNAL(signalStop()), SLOT(slotPlaybackStopped())); - m_player->stop(); - } - else - QTimer::singleShot(0, this, SLOT(slotPlaybackStopped())); -} - -void JuK::slotPlaybackStopped() -{ kapp->quit(); } --- trunk/KDE/kdemultimedia/juk/juk.h #1236081:1236082 @@ -70,7 +70,6 @@ void slotShowHide(); void slotAboutToQuit(); void slotQuit(); - void slotPlaybackStopped(); void slotToggleSystemTray(bool enabled); void slotEditKeys(); void slotConfigureTagGuesser();