diff --git a/src/modules/MouseWithoutBorders/App/Class/Common.Log.cs b/src/modules/MouseWithoutBorders/App/Class/Common.Log.cs index 4736a74cf6..c343bed3e5 100644 --- a/src/modules/MouseWithoutBorders/App/Class/Common.Log.cs +++ b/src/modules/MouseWithoutBorders/App/Class/Common.Log.cs @@ -90,7 +90,19 @@ namespace MouseWithoutBorders lock (ThreadsLock) { #pragma warning disable 618 // Temporary - threads.Where(t => t.IsAlive && t.ManagedThreadId != threadId).ToList().ForEach(t => t.Suspend()); + threads.Where(t => t.IsAlive && t.ManagedThreadId != threadId).ToList().ForEach( + t => + { + try + { + t.Suspend(); + } + catch (Exception) + { + // This method is suspending every thread so that it can kill the process right after restarting. + // Makes no sense to crash on a thread suspension fail, since we're killing the process afterwards, anyway. + } + }); #pragma warning restore 618 } }