mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 13:06:24 +00:00
Correctly implemented Dispose for update-triggers
This commit is contained in:
1 parent
cabb9825be
commit
c98ffd2dbf
4 files changed
+12
-3
No files matched your search
@@ -139,6 +139,10 @@ namespace RGB.NET.Core
|
|||||||
try { deviceProvider.Dispose(); }
|
try { deviceProvider.Dispose(); }
|
||||||
catch { /* We do what we can */ }
|
catch { /* We do what we can */ }
|
||||||
|
|
||||||
|
foreach (IUpdateTrigger updateTrigger in _updateTriggers)
|
||||||
|
try { updateTrigger.Dispose(); }
|
||||||
|
catch { /* We do what we can */ }
|
||||||
|
|
||||||
_ledGroups.Clear();
|
_ledGroups.Clear();
|
||||||
_devices = null;
|
_devices = null;
|
||||||
_deviceProvider = null;
|
_deviceProvider = null;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace RGB.NET.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a generic update trigger.
|
/// Represents a generic update trigger.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AbstractUpdateTrigger : AbstractBindable, IUpdateTrigger
|
public abstract class AbstractUpdateTrigger : AbstractBindable, IUpdateTrigger
|
||||||
{
|
{
|
||||||
#region Events
|
#region Events
|
||||||
|
|
||||||
@@ -31,8 +31,7 @@ namespace RGB.NET.Core
|
|||||||
protected virtual void OnUpdate(CustomUpdateData updateData = null) => Update?.Invoke(this, updateData);
|
protected virtual void OnUpdate(CustomUpdateData updateData = null) => Update?.Invoke(this, updateData);
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual void Dispose()
|
public abstract void Dispose();
|
||||||
{ }
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,6 +144,9 @@ namespace RGB.NET.Core
|
|||||||
UpdateFrequency = UpdateRateHardLimit;
|
UpdateFrequency = UpdateRateHardLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void Dispose() => Stop();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,6 +106,9 @@ namespace RGB.NET.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void Dispose() => Stop();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user