Better logging on exit.

This commit is contained in:
Florian Bruhin 2014-08-02 19:40:24 +02:00
parent 3307c5f518
commit b707987be0

View File

@ -760,7 +760,12 @@ class Application(QApplication):
log.destroy.debug("Deactiving message handler...")
qInstallMessageHandler(None)
# Now we can hopefully quit without segfaults
log.destroy.debug("Calling QApplication::exit...")
log.destroy.debug("Deferring QApplication::exit...")
# We use a singleshot timer to exit here to minimize the likelyhood of
# segfaults.
QTimer.singleShot(0, partial(self.exit, status))
def exit(self, status):
"""Extend QApplication::exit to log the event."""
log.destroy.debug("Now calling QApplication::exit.")
super().exit(status)