mirror of https://github.com/qTox/qTox
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 #6641pull/6644/head
parent
b394f22599
commit
2197bce610
|
@ -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))
|
||||
|
|
|
@ -36,7 +36,7 @@ class AppManager : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AppManager(int argc, char** argv);
|
||||
AppManager(int& argc, char** argv);
|
||||
~AppManager();
|
||||
int run();
|
||||
|
||||
|
|
Loading…
Reference in New Issue