Skip to content

Commit 6788c0e

Browse files
committed
Now killing the other app process only if it didn't exited after call to CloseMainWindow.
1 parent 9e4587d commit 6788c0e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

AutoUpdater.NET/AutoUpdater.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,6 @@ internal static void Exit()
583583
var currentProcess = Process.GetCurrentProcess();
584584
foreach (Process process in Process.GetProcessesByName(currentProcess.ProcessName))
585585
{
586-
if (process.HasExited)
587-
{
588-
continue;
589-
}
590-
591586
try
592587
{
593588
string processPath = process.MainModule?.FileName;
@@ -604,6 +599,11 @@ internal static void Exit()
604599
.TotalMilliseconds); // Give some time to process message
605600
}
606601

602+
if (process.HasExited)
603+
{
604+
continue;
605+
}
606+
607607
process.Kill(); //TODO: Show UI message asking user to close program himself instead of silently killing it
608608
}
609609
catch (Exception)

0 commit comments

Comments
 (0)