Browse Source

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 3 years ago
parent
commit
2197bce610
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 2
      src/appmanager.cpp
  2. 2
      src/appmanager.h

2
src/appmanager.cpp

@ -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))

2
src/appmanager.h

@ -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…
Cancel
Save