Skip to content

Commit

Permalink
mutex refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Valyreon committed Dec 4, 2020
1 parent a8eaab3 commit bdd7baf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions SubloaderWpf/App.xaml.cs
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using System.Windows;
using SubloaderWpf.Models;
Expand All @@ -23,9 +23,12 @@ protected override void OnStartup(StartupEventArgs e)
try
{
mutex = new Mutex(true, "valyreon.subloader", out var isOnlyInstance);
if (!isOnlyInstance && !string.IsNullOrWhiteSpace(PathArg))
if (!isOnlyInstance)
{
InstanceMediator.SendArgumentToRunningInstance(PathArg);
if (!string.IsNullOrWhiteSpace(PathArg))
{
InstanceMediator.SendArgumentToRunningInstance(PathArg);
}

Cleanup();
Environment.Exit(0);
Expand Down

0 comments on commit bdd7baf

Please sign in to comment.