File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,19 @@ Class Application
13
13
14
14
SettingsHandler.InitialiseSettings()
15
15
16
-
17
- If Not SettingsHandler.AppSettings.AllowMultiInstance AndAlso Not mutex.WaitOne( 0 , False ) Then
16
+ Dim acquiredMutex As Boolean
17
+
18
+ Try
19
+ acquiredMutex = mutex.WaitOne( 0 , False )
20
+ Catch ex As AbandonedMutexException
21
+ ' This means the mutex was acquired successfully,
22
+ ' but its last owner exited abruptly, without releasing it.
23
+ ' acquiredMutex should still be True here, but further error checking
24
+ ' on shared program state could be added here as well.
25
+ acquiredMutex = True
26
+ End Try
27
+
28
+ If Not SettingsHandler.AppSettings.AllowMultiInstance AndAlso Not acquiredMutex Then
18
29
19
30
If e.Args.Length <> 0 AndAlso e.Args( 0 ) = "-tray" Then
20
31
MessageBox.Show( "An instance of CompactGUI is already running" )
You can’t perform that action at this time.
0 commit comments