mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Check for dispose before trying to Invoke.
This commit is contained in:
@@ -94,14 +94,14 @@ namespace GHelper
|
||||
|
||||
private void Mouse_MouseReadyChanged(object? sender, EventArgs e)
|
||||
{
|
||||
if (Disposing || IsDisposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!mouse.IsDeviceReady)
|
||||
{
|
||||
this.Invoke(delegate
|
||||
{
|
||||
if (Disposing || IsDisposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Close();
|
||||
});
|
||||
}
|
||||
@@ -109,12 +109,12 @@ namespace GHelper
|
||||
|
||||
private void Mouse_BatteryUpdated(object? sender, EventArgs e)
|
||||
{
|
||||
if (Disposing || IsDisposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.Invoke(delegate
|
||||
{
|
||||
if (Disposing || IsDisposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
VisualizeBatteryState();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user