mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 21:16:24 +00:00
Dispose of each keyboard properly
This commit is contained in:
1 parent
819e6ef1df
commit
f3d63f09a9
5 files changed
+15
-5
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Devices.Wooting.Generic;
|
||||
using RGB.NET.Devices.Wooting.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Wooting.Keyboard;
|
||||
|
||||
@@ -48,5 +49,12 @@ public class WootingKeyboardRGBDevice : WootingRGBDevice<WootingKeyboardRGBDevic
|
||||
/// <inheritdoc />
|
||||
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate) => UpdateQueue.SetData(GetUpdateData(ledsToUpdate));
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
_WootingSDK.SelectDevice(DeviceInfo.WootingDeviceIndex);
|
||||
_WootingSDK.Reset();
|
||||
|
||||
base.Dispose();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -24,8 +24,8 @@ public class WootingKeyboardRGBDeviceInfo : WootingRGBDeviceInfo, IKeyboardDevic
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.Wooting.WootingKeyboardRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceInfo">The native <see cref="T:RGB.NET.Devices.Wooting.Native._WootingDeviceInfo" />.</param>
|
||||
internal WootingKeyboardRGBDeviceInfo(_WootingDeviceInfo deviceInfo)
|
||||
: base(RGBDeviceType.Keyboard, deviceInfo)
|
||||
internal WootingKeyboardRGBDeviceInfo(_WootingDeviceInfo deviceInfo, byte deviceIndex)
|
||||
: base(RGBDeviceType.Keyboard, deviceInfo, deviceIndex)
|
||||
{
|
||||
Layout = WootingLayoutType switch
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user