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
pull/6644/head
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
AppManager::AppManager(int argc, char** argv)
AppManager::AppManager(int& argc, char** argv)
: qapp((preConstructionInitialization(), new QApplication(argc, argv)))
, messageBoxManager(new MessageBoxManager(nullptr))
, settings(new Settings(*messageBoxManager))

View File

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