mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-12 17:48:31 +00:00
Made surface disposable
This commit is contained in:
parent
bce3b1785a
commit
8446b9a47b
@ -11,7 +11,7 @@ namespace RGB.NET.Core
|
||||
/// <summary>
|
||||
/// Represents a RGB-surface containing multiple devices.
|
||||
/// </summary>
|
||||
public partial class RGBSurface : AbstractBindable
|
||||
public partial class RGBSurface : AbstractBindable, IDisposable
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
@ -99,6 +99,18 @@ namespace RGB.NET.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (IRGBDevice device in _devices)
|
||||
try { device.Dispose(); }
|
||||
catch { /* We do what we can */ }
|
||||
|
||||
_ledGroups.Clear();
|
||||
_devices = null;
|
||||
_deviceProvider = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Renders a ledgroup.
|
||||
/// </summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user