From 6b43ddb5610b90fb894c43f6161a99f7a877637c Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Sat, 16 Mar 2013 22:00:10 -0400 Subject: [PATCH] bug fix introduced by previous commit --- sdk/openbr_plugin.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sdk/openbr_plugin.cpp b/sdk/openbr_plugin.cpp index 2220fce..266a309 100644 --- a/sdk/openbr_plugin.cpp +++ b/sdk/openbr_plugin.cpp @@ -796,14 +796,18 @@ bool br::Context::checkSDKPath(const QString &sdkPath) void br::Context::initialize(int argc, char *argv[], const QString &sdkPath) { - if (Globals == NULL) { - // QApplication should be initialzed before anything else + // QApplication should be initialized before anything else. + // Since we can't ensure that it gets deleted last, we never delete it. + static QCoreApplication *application = NULL; + if (application == NULL) { #ifndef BR_EMBEDDED - static QApplication application(argc, argv); + application = new QApplication(argc, argv); #else - static QCoreApplication coreApplication(argc, argv); + application = new QCoreApplication(argc, argv); #endif + } + if (Globals == NULL) { Globals = new Context(); Globals->init(File()); } -- libgit2 0.21.4