aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/GpgFrontendApplication.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-06-01 15:12:20 +0000
committerSaturneric <[email protected]>2022-06-01 15:12:20 +0000
commit769465f1496439c2e7de4ffa9460b1f4a0fe5c2d (patch)
tree65addaec57c7382e998b0b603d8a6ff736616eae /src/ui/GpgFrontendApplication.cpp
parentdoc(manual): fix urls (diff)
downloadGpgFrontend-769465f1496439c2e7de4ffa9460b1f4a0fe5c2d.tar.gz
GpgFrontend-769465f1496439c2e7de4ffa9460b1f4a0fe5c2d.zip
fix(ui): fix crash when start app.
Diffstat (limited to 'src/ui/GpgFrontendApplication.cpp')
-rw-r--r--src/ui/GpgFrontendApplication.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ui/GpgFrontendApplication.cpp b/src/ui/GpgFrontendApplication.cpp
index 4cb50b43..57b36152 100644
--- a/src/ui/GpgFrontendApplication.cpp
+++ b/src/ui/GpgFrontendApplication.cpp
@@ -30,7 +30,7 @@
namespace GpgFrontend::UI {
-GpgFrontendApplication::GpgFrontendApplication(int &argc, char **argv)
+GpgFrontendApplication::GpgFrontendApplication(int& argc, char *argv[])
: QApplication(argc, argv) {
#ifndef MACOS
this->setWindowIcon(QIcon(":gpgfrontend.png"));
@@ -56,13 +56,18 @@ GpgFrontendApplication::GpgFrontendApplication(int &argc, char **argv)
GpgFrontendApplication *GpgFrontendApplication::GetInstance(int argc,
char *argv[],
bool new_instance) {
+
static GpgFrontendApplication *instance = nullptr;
+ static int static_argc = argc;
+ static char **static_argv = argv;
+
if (new_instance || !instance) {
if (instance != nullptr) {
instance->quit();
delete instance;
+ } else {
}
- instance = new GpgFrontendApplication(argc, argv);
+ instance = new GpgFrontendApplication(static_argc, static_argv);
}
return instance;
}