Fix mutex logic for single instance check

Renamed variable to clarify mutex existence and corrected the condition to properly detect if the launcher is already running.
This commit is contained in:
Namhyeon Go 2025-08-26 12:53:48 +09:00
parent 57d0454051
commit d3ecbd7ebe

View File

@ -29,8 +29,8 @@ namespace WelsonJS.Launcher
static void Main() static void Main()
{ {
// create the mutex // create the mutex
_mutex = new Mutex(true, "WelsonJS.Launcher", out bool isAlreadyRunning); _mutex = new Mutex(true, "WelsonJS.Launcher", out bool mutexNotExists);
if (!isAlreadyRunning) if (!mutexNotExists)
{ {
_logger.Error("WelsonJS Launcher already running."); _logger.Error("WelsonJS Launcher already running.");
return; return;