diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-02-21 08:25:29 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-02-21 07:39:49 +0000 |
commit | c0d93d408d4eafcaab06d455b8c3ce1e2c21f8db (patch) | |
tree | 98d47923642db78a2c1cd4110ad57ce05132158e | |
parent | bada5f8ea74d6d9d2a60b35f4d271da143aced51 (diff) | |
download | qtactiveqt-c0d93d408d4eafcaab06d455b8c3ce1e2c21f8db.tar.gz |
QClassFactory::CreateInstanceHelper(): make variable argc static
Otherwise, crashes occur when accessing the arguments of QCoreApplication
since the variable is passed by reference.
Task-number: QTBUG-59047
Change-Id: I5cbeb86814ab048e6d815498484108e9dc828d0a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
-rw-r--r-- | src/activeqt/control/qaxserverbase.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp index 9b7fab8..f2d4262 100644 --- a/src/activeqt/control/qaxserverbase.cpp +++ b/src/activeqt/control/qaxserverbase.cpp @@ -906,7 +906,7 @@ HRESULT QClassFactory::CreateInstanceHelper(IUnknown *pUnkOuter, REFIID iid, voi // Make sure a QApplication instance is present (inprocess case) if (!qApp) { qax_ownQApp = true; - int argc = 0; + 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, 0); } QGuiApplication::setQuitOnLastWindowClosed(false); |