From 54d7dfe4f880d58da13c70f09896b57d8c81e07c Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Wed, 26 Jul 2023 20:32:09 +0200 Subject: [PATCH] Safeguards to prevent crash when closing the window in the exact moment the battery is updated. --- app/AsusMouseSettings.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/AsusMouseSettings.cs b/app/AsusMouseSettings.cs index 3e7c298a..56d101ae 100644 --- a/app/AsusMouseSettings.cs +++ b/app/AsusMouseSettings.cs @@ -95,6 +95,10 @@ namespace GHelper { this.Invoke(delegate { + if (Disposing || IsDisposed) + { + return; + } VisualizeBatteryState(); }); @@ -312,6 +316,10 @@ namespace GHelper //Mouse disconnected. Bye bye. this.Invoke(delegate { + if (Disposing || IsDisposed) + { + return; + } this.Close(); });