From 614facddafe7023be9686812232c97ac3327d160 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 5 Aug 2022 20:43:56 +0200 Subject: [PATCH] fixed a rare exception when lighting systems dispose --- Illumilib/System/LogitechLighting.cs | 6 +++++- Illumilib/System/RazerLighting.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Illumilib/System/LogitechLighting.cs b/Illumilib/System/LogitechLighting.cs index 77fe1d7..413427b 100644 --- a/Illumilib/System/LogitechLighting.cs +++ b/Illumilib/System/LogitechLighting.cs @@ -20,7 +20,11 @@ namespace Illumilib.System { public override void Dispose() { base.Dispose(); this.ClearBitmap(); - LogitechGsdk.LogiLedShutdown(); + try { + LogitechGsdk.LogiLedShutdown(); + } catch { + // ignored + } } public override void SetAllLighting(float r, float g, float b) { diff --git a/Illumilib/System/RazerLighting.cs b/Illumilib/System/RazerLighting.cs index 67fc3ce..618836a 100644 --- a/Illumilib/System/RazerLighting.cs +++ b/Illumilib/System/RazerLighting.cs @@ -22,7 +22,11 @@ namespace Illumilib.System { public override void Dispose() { base.Dispose(); - this.chroma?.UninitializeAsync(); + try { + this.chroma?.UninitializeAsync(); + } catch { + // ignored + } this.effectOutdated = true; }