summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/rbutilqt.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-02-11 19:51:50 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-02-11 19:51:50 +0000
commit446eda80c9be49eaa8c2830aeaa43ecaf3729908 (patch)
treef562c56503857abb717f47492e13a6083e8b7b50 /rbutil/rbutilqt/rbutilqt.cpp
parente5caf93e237a168f923a2eeb7bccaae9b9a51c30 (diff)
downloadrockbox-446eda80c9be49eaa8c2830aeaa43ecaf3729908.tar.gz
rockbox-446eda80c9be49eaa8c2830aeaa43ecaf3729908.tar.bz2
rockbox-446eda80c9be49eaa8c2830aeaa43ecaf3729908.zip
Restore the default message handler on application shutdown. Fixes sporadic segfaults on exit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24599 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 9c9aff7569..4698b3fc58 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -102,6 +102,7 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
connect(ui.action_About, SIGNAL(triggered()), this, SLOT(about()));
connect(ui.action_Help, SIGNAL(triggered()), this, SLOT(help()));
connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog()));
+ connect(ui.actionE_xit, SIGNAL(triggered()), this, SLOT(shutdown()));
connect(ui.buttonChangeDevice, SIGNAL(clicked()), this, SLOT(configDialog()));
connect(ui.buttonRockbox, SIGNAL(clicked()), this, SLOT(installBtn()));
connect(ui.buttonBootloader, SIGNAL(clicked()), this, SLOT(installBootloaderBtn()));
@@ -142,6 +143,16 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
}
+void RbUtilQt::shutdown(void)
+{
+ // restore default message handler to prevent trace accesses during
+ // object destruction -- the trace object could already be destroyed.
+ // Fixes segfaults on exit.
+ qInstallMsgHandler(0);
+ this->close();
+}
+
+
void RbUtilQt::trace(void)
{
SysTrace wnd(this);