Commit fec7fecb authored by Michael Pyne's avatar Michael Pyne
Browse files

Fix bug 144427 (JuK crashes if main window open on logout) in KDE 4.0.

I was not able to reproduce but the reporter did a very good job of hunting down the cause and came up with
a patch which I tweaked to fix the underlying issue.  Basically, we do too much in queryExit().

We already had a slot called slotAboutToQuit() (which was similarly mislabeled) so I used the "official"
means of hooking up to QCoreApplication::aboutToQuit(), and implemented the reporter's patch of setting
the deleted object to 0 in case we try to delete it again somehow.

CCBUG:144427

svn path=/branches/KDE/4.0/kdemultimedia/juk/; revision=811443
parent 4e3d3d0b
......@@ -2,6 +2,9 @@
begin : Mon Feb 4 23:40:41 EST 2002
copyright : (C) 2002 - 2004 by Scott Wheeler
email : wheeler@kde.org
copyright : (C) 2008 by Michael Pyne
email : michael.pyne@kdemail.net
***************************************************************************/
/***************************************************************************
......@@ -34,6 +37,7 @@
#include <ktoolbarpopupaction.h>
#include <kdeversion.h>
#include <QCoreApplication>
#include <QKeyEvent>
#include <QDir>
#include <QTimer>
......@@ -295,7 +299,8 @@ void JuK::setupSystemTray()
m_toggleDockOnCloseAction->setEnabled(true);
m_togglePopupsAction->setEnabled(true);
connect(m_systemTray, SIGNAL(quitSelected()), this, SLOT(slotAboutToQuit()));
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), SLOT(slotAboutToQuit()));
connect(m_systemTray, SIGNAL(quitSelected()), this, SLOT(slotQuit()));
}
else {
m_systemTray = 0;
......@@ -442,21 +447,13 @@ void JuK::saveConfig()
bool JuK::queryExit()
{
m_startDocked = !isVisible();
kDebug(65432) ;
hide();
action("stop")->trigger();
delete m_systemTray;
m_systemTray = 0;
// This may actually be sent more than once in practice, but we're not
// supposed to do end of execution destruction yet anyways, use
// slotAboutToQuit for that.
CoverManager::shutdown();
Cache::instance()->save();
m_startDocked = !isVisible();
saveConfig();
delete m_splitter;
return true;
}
......@@ -492,6 +489,17 @@ void JuK::slotShowHide()
void JuK::slotAboutToQuit()
{
m_shuttingDown = true;
action("stop")->trigger();
delete m_systemTray;
m_systemTray = 0;
CoverManager::shutdown();
Cache::instance()->save();
saveConfig();
delete m_splitter;
m_splitter = 0;
}
void JuK::slotQuit()
......
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