diff options
-rw-r--r-- | src/activeqt/control/qaxserver.cpp | 6 | ||||
-rw-r--r-- | src/activeqt/control/qaxserverbase.cpp | 3 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/activeqt/control/qaxserver.cpp b/src/activeqt/control/qaxserver.cpp index d7ea1d2..aa4b951 100644 --- a/src/activeqt/control/qaxserver.cpp +++ b/src/activeqt/control/qaxserver.cpp @@ -438,8 +438,7 @@ HRESULT UpdateRegistry(bool bRegister, bool perUser) // we try to create the ActiveX widgets later on... bool delete_qApp = false; if (!qApp) { - static int argc = 0; // static lifetime, since it's passed as reference to QApplication, which has a lifetime exceeding the stack frame - (void)new QApplication(argc, nullptr); + (void)new QApplication(__argc, __argv); delete_qApp = true; } @@ -1145,8 +1144,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver) // dummy application to create widgets bool delete_qApp = false; if (!qApp) { - static int argc = 0; // static lifetime, since it's passed as reference to QApplication, which has a lifetime exceeding the stack frame - (void)new QApplication(argc, nullptr); + (void)new QApplication(__argc, __argv); delete_qApp = true; } diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp index ac52583..0800cd9 100644 --- a/src/activeqt/control/qaxserverbase.cpp +++ b/src/activeqt/control/qaxserverbase.cpp @@ -882,8 +882,7 @@ HRESULT QClassFactory::CreateInstanceHelper(IUnknown *pUnkOuter, REFIID iid, voi // Make sure a QApplication instance is present (inprocess case) if (!qApp) { qax_ownQApp = true; - static int argc = 0; // static lifetime, since it's passed as reference to QApplication, which has a lifetime exceeding the stack frame - new QApplication(argc, nullptr); + new QApplication(__argc, __argv); } QGuiApplication::setQuitOnLastWindowClosed(false); |