Commit 6b43ddb5610b90fb894c43f6161a99f7a877637c
1 parent
2d3b8cd5
bug fix introduced by previous commit
Showing
1 changed file
with
8 additions
and
4 deletions
sdk/openbr_plugin.cpp
| @@ -796,14 +796,18 @@ bool br::Context::checkSDKPath(const QString &sdkPath) | @@ -796,14 +796,18 @@ bool br::Context::checkSDKPath(const QString &sdkPath) | ||
| 796 | 796 | ||
| 797 | void br::Context::initialize(int argc, char *argv[], const QString &sdkPath) | 797 | void br::Context::initialize(int argc, char *argv[], const QString &sdkPath) |
| 798 | { | 798 | { |
| 799 | - if (Globals == NULL) { | ||
| 800 | - // QApplication should be initialzed before anything else | 799 | + // QApplication should be initialized before anything else. |
| 800 | + // Since we can't ensure that it gets deleted last, we never delete it. | ||
| 801 | + static QCoreApplication *application = NULL; | ||
| 802 | + if (application == NULL) { | ||
| 801 | #ifndef BR_EMBEDDED | 803 | #ifndef BR_EMBEDDED |
| 802 | - static QApplication application(argc, argv); | 804 | + application = new QApplication(argc, argv); |
| 803 | #else | 805 | #else |
| 804 | - static QCoreApplication coreApplication(argc, argv); | 806 | + application = new QCoreApplication(argc, argv); |
| 805 | #endif | 807 | #endif |
| 808 | + } | ||
| 806 | 809 | ||
| 810 | + if (Globals == NULL) { | ||
| 807 | Globals = new Context(); | 811 | Globals = new Context(); |
| 808 | Globals->init(File()); | 812 | Globals->init(File()); |
| 809 | } | 813 | } |