1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(AppManager): Don't create temporary copy of argc

QApplication takes argc by reference, so copying it in to AppManager's
constructor causes QApplication's to have an invalid reference once AppManager's
constructor returns.

Instead just reference main's argc.

Fix #6641
This commit is contained in:
Anthony Bilinski 2022-06-14 16:23:50 -07:00
parent b394f22599
commit 2197bce610
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
2 changed files with 2 additions and 2 deletions

View File

@ -162,7 +162,7 @@ bool toxURIEventHandler(const QByteArray& eventData, void* userData)
} }
} // namespace } // namespace
AppManager::AppManager(int argc, char** argv) AppManager::AppManager(int& argc, char** argv)
: qapp((preConstructionInitialization(), new QApplication(argc, argv))) : qapp((preConstructionInitialization(), new QApplication(argc, argv)))
, messageBoxManager(new MessageBoxManager(nullptr)) , messageBoxManager(new MessageBoxManager(nullptr))
, settings(new Settings(*messageBoxManager)) , settings(new Settings(*messageBoxManager))

View File

@ -36,7 +36,7 @@ class AppManager : public QObject
Q_OBJECT Q_OBJECT
public: public:
AppManager(int argc, char** argv); AppManager(int& argc, char** argv);
~AppManager(); ~AppManager();
int run(); int run();