diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs index 80f3c07..6787c99 100644 --- a/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs +++ b/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs @@ -177,6 +177,12 @@ namespace WelsonJS.Launcher { Program.InitializeResourceServer(); + if (Program._resourceServer == null) + { + _logger.Error("Resource server failed to initialize."); + return false; + } + if (!Program._resourceServer.IsRunning()) { Program._resourceServer.Start(false); diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs index 9ff1efe..23547c6 100644 --- a/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs +++ b/WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs @@ -32,7 +32,7 @@ namespace WelsonJS.Launcher _mutex = new Mutex(true, "WelsonJS.Launcher", out bool createdNew); if (!createdNew) { - _logger.Error("WelsonJS Launcher already running."); + _logger.Info("WelsonJS Launcher already running."); return; } @@ -42,7 +42,9 @@ namespace WelsonJS.Launcher Application.Run(new MainForm(_logger)); // destory the mutex - _mutex.ReleaseMutex(); + try { + _mutex.ReleaseMutex(); + } catch { /* ignore if not owned */ } _mutex.Dispose(); }