mirror of
https://github.com/Ellpeck/Illumilib.git
synced 2024-11-16 10:03:13 +01:00
ensure that lighting systems are properly disposed
This commit is contained in:
parent
9a5391573b
commit
c3e7d56248
4 changed files with 10 additions and 6 deletions
|
@ -26,10 +26,6 @@ namespace Illumilib.System {
|
|||
}
|
||||
}
|
||||
|
||||
public override void Dispose() {
|
||||
// no op
|
||||
}
|
||||
|
||||
public override void SetAllLighting(float r, float g, float b) {
|
||||
foreach (var device in this.devices) {
|
||||
device.SetAllColors(r, g, b);
|
||||
|
|
|
@ -5,9 +5,11 @@ namespace Illumilib.System {
|
|||
|
||||
public abstract LightingType Type { get; }
|
||||
|
||||
public abstract bool Initialize();
|
||||
~LightingSystem() {
|
||||
this.Dispose();
|
||||
}
|
||||
|
||||
public abstract void Dispose();
|
||||
public abstract bool Initialize();
|
||||
|
||||
public abstract void SetAllLighting(float r, float g, float b);
|
||||
|
||||
|
@ -21,5 +23,9 @@ namespace Illumilib.System {
|
|||
|
||||
public abstract void SetMouseLighting(float r, float g, float b);
|
||||
|
||||
public virtual void Dispose() {
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -18,6 +18,7 @@ namespace Illumilib.System {
|
|||
}
|
||||
|
||||
public override void Dispose() {
|
||||
base.Dispose();
|
||||
this.ClearBitmap();
|
||||
LogitechGsdk.LogiLedShutdown();
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ namespace Illumilib.System {
|
|||
}
|
||||
|
||||
public override void Dispose() {
|
||||
base.Dispose();
|
||||
this.chroma.UninitializeAsync();
|
||||
this.effectOutdated = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue