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:
parent
b394f22599
commit
2197bce610
|
@ -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))
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user