mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Made surface disposable
This commit is contained in:
parent
bce3b1785a
commit
8446b9a47b
@ -11,7 +11,7 @@ namespace RGB.NET.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a RGB-surface containing multiple devices.
|
/// Represents a RGB-surface containing multiple devices.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class RGBSurface : AbstractBindable
|
public partial class RGBSurface : AbstractBindable, IDisposable
|
||||||
{
|
{
|
||||||
#region Properties & Fields
|
#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>
|
/// <summary>
|
||||||
/// Renders a ledgroup.
|
/// Renders a ledgroup.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user