Skip to content
Snippets Groups Projects
Commit 2db01ed4 authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

runguard: fix the issue that the app cannot be shown when the second instance runs

Change-Id: I764085eaf2cd1613fda738f28a510dcbef71ab0b
parent 0b055b16
No related branches found
No related tags found
No related merge requests found
...@@ -33,21 +33,22 @@ main(int argc, char* argv[]) ...@@ -33,21 +33,22 @@ main(int argc, char* argv[])
MainApplication::applicationInitialization(); MainApplication::applicationInitialization();
char ARG_DISABLE_WEB_SECURITY[] = "--disable-web-security";
auto newArgv = MainApplication::parseInputArgument(argc, argv, ARG_DISABLE_WEB_SECURITY);
MainApplication a(argc, newArgv);
// runguard to make sure that only one instance runs at a time // runguard to make sure that only one instance runs at a time
// Note: needs to be after the creation of the application
QCryptographicHash appData(QCryptographicHash::Sha256); QCryptographicHash appData(QCryptographicHash::Sha256);
appData.addData(QApplication::applicationName().toUtf8()); appData.addData(QApplication::applicationName().toUtf8());
appData.addData(QApplication::organizationDomain().toUtf8()); appData.addData(QApplication::organizationDomain().toUtf8());
RunGuard guard(appData.result()); RunGuard guard(appData.result());
if (!guard.tryToRun()) { if (!guard.tryToRun()) {
// no need to exitApp since app is not set up // no need to exitApp since app is not set up
guard.release();
return 0; return 0;
} }
char ARG_DISABLE_WEB_SECURITY[] = "--disable-web-security";
auto newArgv = MainApplication::parseInputArgument(argc, argv, ARG_DISABLE_WEB_SECURITY);
MainApplication a(argc, newArgv);
if (!a.applicationSetup()) { if (!a.applicationSetup()) {
guard.release(); guard.release();
a.exitApp(); a.exitApp();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment