From ab41f1ec6aba5a220a3d167648359f44f4603b7b Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 18 Apr 2017 10:08:25 +0100 Subject: [PATCH] Change python global init/shutdown order to be safe vs running contexts * If a window (like the PythonShell) owned a context and only stopped it on destruction, it would be destructed after the global shutdown destroyed the interpreter. --- qrenderdoc/Code/qrenderdoc.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/qrenderdoc/Code/qrenderdoc.cpp b/qrenderdoc/Code/qrenderdoc.cpp index e9eb158af..6c7a377c3 100644 --- a/qrenderdoc/Code/qrenderdoc.cpp +++ b/qrenderdoc/Code/qrenderdoc.cpp @@ -159,19 +159,19 @@ int main(int argc, char *argv[]) GUIInvoke::init(); - CaptureContext ctx(filename, remoteHost, remoteIdent, temp, config); - PythonContext::GlobalInit(); - - while(ctx.isRunning()) { - application.processEvents(QEventLoop::WaitForMoreEvents); - QCoreApplication::sendPostedEvents(); + CaptureContext ctx(filename, remoteHost, remoteIdent, temp, config); + + while(ctx.isRunning()) + { + application.processEvents(QEventLoop::WaitForMoreEvents); + QCoreApplication::sendPostedEvents(); + } + + config.Save(); } - PythonContext::GlobalShutdown(); - - config.Save(); } delete[] argv_mod;