Skip to content

Commit

Permalink
Now killing the other app process only if it didn't exited after call…
Browse files Browse the repository at this point in the history
… to CloseMainWindow.
  • Loading branch information
ravibpatel committed Jun 1, 2024
1 parent 9e4587d commit 6788c0e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions AutoUpdater.NET/AutoUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -583,11 +583,6 @@ internal static void Exit()
var currentProcess = Process.GetCurrentProcess();
foreach (Process process in Process.GetProcessesByName(currentProcess.ProcessName))
{
if (process.HasExited)
{
continue;
}

try
{
string processPath = process.MainModule?.FileName;
Expand All @@ -604,6 +599,11 @@ internal static void Exit()
.TotalMilliseconds); // Give some time to process message
}

if (process.HasExited)
{
continue;
}

process.Kill(); //TODO: Show UI message asking user to close program himself instead of silently killing it
}
catch (Exception)
Expand Down

0 comments on commit 6788c0e

Please sign in to comment.