Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-windows
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-client-windows
Commits
2db01ed4
Commit
2db01ed4
authored
5 years ago
by
Ming Rui Zhang
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.cpp
+6
-5
6 additions, 5 deletions
src/main.cpp
with
6 additions
and
5 deletions
src/main.cpp
+
6
−
5
View file @
2db01ed4
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment