Uninstall Qt message handler on quit.

This caused segfaults while exiting for some reason.
This commit is contained in:
Florian Bruhin 2014-06-03 15:19:48 +02:00
parent ec25821fae
commit 04c3a912e8

View File

@ -39,7 +39,8 @@ from argparse import ArgumentParser
from base64 import b64encode from base64 import b64encode
from PyQt5.QtWidgets import QApplication, QDialog, QMessageBox from PyQt5.QtWidgets import QApplication, QDialog, QMessageBox
from PyQt5.QtCore import pyqtSlot, QTimer, QEventLoop, Qt, QStandardPaths from PyQt5.QtCore import (pyqtSlot, QTimer, QEventLoop, Qt, QStandardPaths,
qInstallMessageHandler)
import qutebrowser import qutebrowser
import qutebrowser.commands.utils as cmdutils import qutebrowser.commands.utils as cmdutils
@ -642,6 +643,8 @@ class QuteBrowser(QApplication):
os.remove(self._crashlogfile.name) os.remove(self._crashlogfile.name)
except PermissionError: except PermissionError:
pass pass
# If we don't kill our custom handler here we might get segfaults
qInstallMessageHandler(None)
self._maybe_quit('main') self._maybe_quit('main')
@pyqtSlot() @pyqtSlot()