1
0
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:
Darth Affe 2017-04-02 11:27:24 +02:00
parent bce3b1785a
commit 8446b9a47b

View File

@ -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>