From 664d630b96e90cca47c08e97ed347bd331f57953 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 20 Oct 2013 15:38:24 -0400 Subject: [PATCH] Fixed occasional core dumps on exit --- qt/run_template.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qt/run_template.py b/qt/run_template.py index 0a209897..ffe5b36b 100644 --- a/qt/run_template.py +++ b/qt/run_template.py @@ -23,7 +23,7 @@ from core_{edition} import __version__, __appname__ if ISWINDOWS: import qt.base.cxfreeze_fix -if __name__ == "__main__": +def main(): app = QApplication(sys.argv) QCoreApplication.setOrganizationName('Hardcoded Software') QCoreApplication.setApplicationName(__appname__) @@ -41,4 +41,7 @@ if __name__ == "__main__": if not ISWINDOWS: dgapp.model.registered = True install_excepthook() - sys.exit(app.exec_()) + return app.exec() + +if __name__ == "__main__": + sys.exit(main())