From c6a68116e66ecfbc41af647a65022b0441cadd78 Mon Sep 17 00:00:00 2001 From: Stefano Bonicatti Date: Wed, 27 Dec 2023 22:17:55 +0100 Subject: [PATCH] Fix crash on exit by uninstalling Qt message handler If we don't uninstall the message handler before exiting, if Qt has messages to send after the python application side has been destroyed, Qt will crash trying to call the python interpreter. One examples of such messages are the ones that are enabled through QT_DEBUG_PLUGINS, which report the libraries that get unloaded. --- beeref/__main__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/beeref/__main__.py b/beeref/__main__.py index edd1ee1..4899c83 100755 --- a/beeref/__main__.py +++ b/beeref/__main__.py @@ -123,6 +123,7 @@ def main(): del bee del app logger.debug('BeeRef closed') + QtCore.qInstallMessageHandler(None) if __name__ == '__main__':