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:
@@ -93,28 +93,28 @@ namespace GHelper
|
||||
}
|
||||
|
||||
private void Mouse_MouseReadyChanged(object? sender, EventArgs e)
|
||||
{
|
||||
if (!mouse.IsDeviceReady)
|
||||
{
|
||||
this.Invoke(delegate
|
||||
{
|
||||
if (Disposing || IsDisposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!mouse.IsDeviceReady)
|
||||
{
|
||||
this.Invoke(delegate
|
||||
{
|
||||
Close();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void Mouse_BatteryUpdated(object? sender, EventArgs e)
|
||||
{
|
||||
this.Invoke(delegate
|
||||
{
|
||||
if (Disposing || IsDisposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.Invoke(delegate
|
||||
{
|
||||
VisualizeBatteryState();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user