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
This commit is contained in:
Dominik Riebeling 2010-02-11 19:51:50 +00:00
parent e5caf93e23
commit 446eda80c9
3 changed files with 426 additions and 430 deletions

View file

@ -102,6 +102,7 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
connect(ui.action_About, SIGNAL(triggered()), this, SLOT(about())); connect(ui.action_About, SIGNAL(triggered()), this, SLOT(about()));
connect(ui.action_Help, SIGNAL(triggered()), this, SLOT(help())); connect(ui.action_Help, SIGNAL(triggered()), this, SLOT(help()));
connect(ui.action_Configure, SIGNAL(triggered()), this, SLOT(configDialog())); 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.buttonChangeDevice, SIGNAL(clicked()), this, SLOT(configDialog()));
connect(ui.buttonRockbox, SIGNAL(clicked()), this, SLOT(installBtn())); connect(ui.buttonRockbox, SIGNAL(clicked()), this, SLOT(installBtn()));
connect(ui.buttonBootloader, SIGNAL(clicked()), this, SLOT(installBootloaderBtn())); 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) void RbUtilQt::trace(void)
{ {
SysTrace wnd(this); SysTrace wnd(this);

View file

@ -64,6 +64,7 @@ class RbUtilQt : public QMainWindow
bool m_auto; bool m_auto;
private slots: private slots:
void shutdown(void);
void about(void); void about(void);
void help(void); void help(void);
void sysinfo(void); void sysinfo(void);

View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>RbUtilQtFrm</class> <class>RbUtilQtFrm</class>
<widget class="QMainWindow" name="RbUtilQtFrm"> <widget class="QMainWindow" name="RbUtilQtFrm">
@ -73,7 +74,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelDeviceTitle"> <widget class="QLabel" name="labelDeviceTitle">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" > <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -150,7 +151,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="labelComplete"> <widget class="QLabel" name="labelComplete">
<property name="text"> <property name="text">
<string>&lt;b>Complete Installation&lt;/b>&lt;br/>This installs the bootloader, a current build and the extras package. This is the recommended method for new installations.</string> <string>&lt;b&gt;Complete Installation&lt;/b&gt;&lt;br/&gt;This installs the bootloader, a current build and the extras package. This is the recommended method for new installations.</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::AutoText</enum> <enum>Qt::AutoText</enum>
@ -180,7 +181,7 @@
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLabel" name="labelSmall"> <widget class="QLabel" name="labelSmall">
<property name="text"> <property name="text">
<string>&lt;b>Minimal installation&lt;/b>&lt;br/>This installs bootloader and the current build of Rockbox. If you don't want the extras package, choose this option.</string> <string>&lt;b&gt;Minimal installation&lt;/b&gt;&lt;br/&gt;This installs bootloader and the current build of Rockbox. If you don't want the extras package, choose this option.</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@ -246,7 +247,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="labelBootloader"> <widget class="QLabel" name="labelBootloader">
<property name="text"> <property name="text">
<string>&lt;b>Install the bootloader&lt;/b>&lt;br/>Before Rockbox can be run on your audio player, you may have to install a bootloader. This is only necessary the first time Rockbox is installed.</string> <string>&lt;b&gt;Install the bootloader&lt;/b&gt;&lt;br/&gt;Before Rockbox can be run on your audio player, you may have to install a bootloader. This is only necessary the first time Rockbox is installed.</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@ -273,7 +274,7 @@
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLabel" name="labelInstall"> <widget class="QLabel" name="labelInstall">
<property name="text"> <property name="text">
<string>&lt;b>Install Rockbox&lt;/b> on your audio player</string> <string>&lt;b&gt;Install Rockbox&lt;/b&gt; on your audio player</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -342,7 +343,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="labelFonts"> <widget class="QLabel" name="labelFonts">
<property name="text"> <property name="text">
<string>&lt;b>Fonts Package&lt;/b>&lt;br/>The Fonts Package contains a couple of commonly used fonts. Installation is highly recommended.</string> <string>&lt;b&gt;Fonts Package&lt;/b&gt;&lt;br/&gt;The Fonts Package contains a couple of commonly used fonts. Installation is highly recommended.</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@ -369,7 +370,7 @@
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLabel" name="labelThemes"> <widget class="QLabel" name="labelThemes">
<property name="text"> <property name="text">
<string>&lt;b>Install Themes&lt;/b>&lt;br/>Rockbox' look can be customized by themes. You can choose and install several officially distributed themes.</string> <string>&lt;b&gt;Install Themes&lt;/b&gt;&lt;br/&gt;Rockbox' look can be customized by themes. You can choose and install several officially distributed themes.</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@ -396,7 +397,7 @@
<item row="2" column="1"> <item row="2" column="1">
<widget class="QLabel" name="labelGames"> <widget class="QLabel" name="labelGames">
<property name="text"> <property name="text">
<string>&lt;b>Install Game Files&lt;/b>&lt;br/>Doom needs a base wad file to run.</string> <string>&lt;b&gt;Install Game Files&lt;/b&gt;&lt;br/&gt;Doom needs a base wad file to run.</string>
</property> </property>
<property name="openExternalLinks"> <property name="openExternalLinks">
<bool>true</bool> <bool>true</bool>
@ -459,7 +460,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="labelVoice"> <widget class="QLabel" name="labelVoice">
<property name="text"> <property name="text">
<string>&lt;b>Install Voice file&lt;/b>&lt;br/>Voice files are needed to make Rockbox speak the user interface. Speaking is enabled by default, so if you installed the voice file Rockbox will speak.</string> <string>&lt;b&gt;Install Voice file&lt;/b&gt;&lt;br/&gt;Voice files are needed to make Rockbox speak the user interface. Speaking is enabled by default, so if you installed the voice file Rockbox will speak.</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@ -486,7 +487,7 @@
<item row="2" column="1"> <item row="2" column="1">
<widget class="QLabel" name="labelTalk"> <widget class="QLabel" name="labelTalk">
<property name="text"> <property name="text">
<string>&lt;b>Create Talk Files&lt;/b>&lt;br/>Talkfiles are needed to let Rockbox speak File and Foldernames</string> <string>&lt;b&gt;Create Talk Files&lt;/b&gt;&lt;br/&gt;Talkfiles are needed to let Rockbox speak File and Foldernames</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -536,7 +537,7 @@
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLabel" name="labelCreateVoice"> <widget class="QLabel" name="labelCreateVoice">
<property name="text"> <property name="text">
<string>&lt;b>Create Voice file&lt;/b>&lt;br/>Voice files are needed to make Rockbox speak the user interface. Speaking is enabled by default, so&#xd; <string>&lt;b&gt;Create Voice file&lt;/b&gt;&lt;br/&gt;Voice files are needed to make Rockbox speak the user interface. Speaking is enabled by default, so
if you installed the voice file Rockbox will speak.</string> if you installed the voice file Rockbox will speak.</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
@ -574,7 +575,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="labelRemoveBootloader"> <widget class="QLabel" name="labelRemoveBootloader">
<property name="text"> <property name="text">
<string>&lt;b>Remove the bootloader&lt;/b>&lt;br/>After removing the bootloader you won't be able to start Rockbox.</string> <string>&lt;b&gt;Remove the bootloader&lt;/b&gt;&lt;br/&gt;After removing the bootloader you won't be able to start Rockbox.</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@ -601,7 +602,7 @@
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLabel" name="labelUninstall"> <widget class="QLabel" name="labelUninstall">
<property name="text"> <property name="text">
<string>&lt;b>Uninstall Rockbox from your audio player.&lt;/b>&lt;br/>This will leave the bootloader in place (you need to remove it manually).</string> <string>&lt;b&gt;Uninstall Rockbox from your audio player.&lt;/b&gt;&lt;br/&gt;This will leave the bootloader in place (you need to remove it manually).</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -755,7 +756,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelInfo"> <widget class="QLabel" name="labelInfo">
<property name="text"> <property name="text">
<string>Currently installed packages.&lt;br/>&lt;b>Note:&lt;/b> if you manually installed packages this might not be correct!</string> <string>Currently installed packages.&lt;br/&gt;&lt;b&gt;Note:&lt;/b&gt; if you manually installed packages this might not be correct!</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::RichText</enum> <enum>Qt::RichText</enum>
@ -786,7 +787,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>650</width> <width>650</width>
<height>31</height> <height>18</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menu_File"> <widget class="QMenu" name="menu_File">
@ -1075,22 +1076,5 @@
<resources> <resources>
<include location="rbutilqt.qrc"/> <include location="rbutilqt.qrc"/>
</resources> </resources>
<connections> <connections/>
<connection>
<sender>actionE_xit</sender>
<signal>triggered()</signal>
<receiver>RbUtilQtFrm</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel" >
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel" >
<x>279</x>
<y>315</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>