1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 10:08:31 +00:00

Merge pull request #114 from DarthAffe/Fix/Dispose

Fix/dispose
This commit is contained in:
DarthAffe 2020-03-03 15:24:08 +01:00 committed by GitHub
commit d187ecb997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 246 additions and 65 deletions

View File

@ -157,8 +157,12 @@ namespace RGB.NET.Core
/// <inheritdoc />
public virtual void Dispose()
{
SpecialDeviceParts.Clear();
LedMapping.Clear();
try
{
SpecialDeviceParts.Clear();
LedMapping.Clear();
}
catch { /* this really shouldn't happen */ }
}
/// <summary>

View File

@ -139,6 +139,10 @@ namespace RGB.NET.Core
try { deviceProvider.Dispose(); }
catch { /* We do what we can */ }
foreach (IUpdateTrigger updateTrigger in _updateTriggers)
try { updateTrigger.Dispose(); }
catch { /* We do what we can */ }
_ledGroups.Clear();
_devices = null;
_deviceProvider = null;

View File

@ -5,7 +5,7 @@ namespace RGB.NET.Core
/// <summary>
/// Represents a generic update trigger.
/// </summary>
public class AbstractUpdateTrigger : AbstractBindable, IUpdateTrigger
public abstract class AbstractUpdateTrigger : AbstractBindable, IUpdateTrigger
{
#region Events
@ -31,8 +31,7 @@ namespace RGB.NET.Core
protected virtual void OnUpdate(CustomUpdateData updateData = null) => Update?.Invoke(this, updateData);
/// <inheritdoc />
public virtual void Dispose()
{ }
public abstract void Dispose();
#endregion
}

View File

@ -144,6 +144,9 @@ namespace RGB.NET.Core
UpdateFrequency = UpdateRateHardLimit;
}
/// <inheritdoc />
public override void Dispose() => Stop();
#endregion
}
}

View File

@ -106,6 +106,9 @@ namespace RGB.NET.Core
}
}
/// <inheritdoc />
public override void Dispose() => Stop();
#endregion
}
}

View File

@ -172,7 +172,12 @@ namespace RGB.NET.Devices.Asus
/// <inheritdoc />
public void Dispose()
{
_sdk?.ReleaseControl(0);
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
try { _sdk?.ReleaseControl(0); }
catch { /* at least we tried */ }
_sdk = null;
}

View File

@ -80,6 +80,15 @@ namespace RGB.NET.Devices.Asus
//}
}
/// <inheritdoc />
public override void Dispose()
{
try { UpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
base.Dispose();
}
#endregion
}
}

View File

@ -228,7 +228,7 @@ namespace RGB.NET.Devices.Asus
catch { if (throwExceptions) throw; }
#endregion
UpdateTrigger?.Start();
Devices = new ReadOnlyCollection<IRGBDevice>(devices);
@ -267,7 +267,13 @@ namespace RGB.NET.Devices.Asus
/// <inheritdoc />
public void Dispose()
{ }
{
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
try { _AsusSDK.UnloadAsusSDK(); }
catch { /* at least we tried */ }
}
#endregion
}

View File

@ -80,6 +80,9 @@ namespace RGB.NET.Devices.Asus
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}.Dispose" />
public override void Dispose()
{
try { UpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
if ((DeviceInfo is AsusRGBDeviceInfo deviceInfo) && (deviceInfo.Handle != IntPtr.Zero))
Marshal.FreeHGlobal(deviceInfo.Handle);

View File

@ -75,7 +75,7 @@ namespace RGB.NET.Devices.Asus.Native
//_getDramColorPointer = (GetDramColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "GetDramColor"), typeof(GetDramColorPointer));
}
private static void UnloadAsusSDK()
internal static void UnloadAsusSDK()
{
if (_dllHandle == IntPtr.Zero) return;

View File

@ -108,7 +108,7 @@ namespace RGB.NET.Devices.CoolerMaster
{
RGBDeviceType deviceType = index.GetDeviceType();
if (deviceType == RGBDeviceType.None) continue;
if (_CoolerMasterSDK.IsDevicePlugged(index))
{
if (!loadFilter.HasFlag(deviceType)) continue;
@ -175,6 +175,9 @@ namespace RGB.NET.Devices.CoolerMaster
/// <inheritdoc />
public void Dispose()
{
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
if (IsInitialized)
foreach (IRGBDevice device in Devices)
{
@ -185,6 +188,9 @@ namespace RGB.NET.Devices.CoolerMaster
}
catch {/* shit happens */}
}
try { _CoolerMasterSDK.UnloadCMSDK(); }
catch { /* at least we tried */ }
}
#endregion

View File

@ -74,6 +74,9 @@ namespace RGB.NET.Devices.CoolerMaster
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}.Dispose" />
public override void Dispose()
{
try { UpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
_CoolerMasterSDK.EnableLedControl(false, DeviceInfo.DeviceIndex);
base.Dispose();

View File

@ -52,7 +52,7 @@ namespace RGB.NET.Devices.CoolerMaster.Native
_setAllLedColorPointer = (SetAllLedColorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "SetAllLedColor"), typeof(SetAllLedColorPointer));
}
private static void UnloadCMSDK()
internal static void UnloadCMSDK()
{
if (_dllHandle == IntPtr.Zero) return;

View File

@ -292,7 +292,13 @@ namespace RGB.NET.Devices.Corsair
/// <inheritdoc />
public void Dispose()
{ }
{
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
try { _CUESDK.UnloadCUESDK(); }
catch { /* at least we tried */ }
}
#endregion
}

View File

@ -122,6 +122,15 @@ namespace RGB.NET.Devices.Corsair
Marshal.FreeHGlobal(ptr);
}
/// <inheritdoc />
public override void Dispose()
{
try { DeviceUpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
base.Dispose();
}
#endregion
}
}

View File

@ -56,7 +56,7 @@ namespace RGB.NET.Devices.Corsair.Native
_corsairGetLastErrorPointer = (CorsairGetLastErrorPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "CorsairGetLastError"), typeof(CorsairGetLastErrorPointer));
}
private static void UnloadCUESDK()
internal static void UnloadCUESDK()
{
if (_dllHandle == IntPtr.Zero) return;
@ -136,7 +136,7 @@ namespace RGB.NET.Devices.Corsair.Native
#endregion
// ReSharper disable EventExceptionNotDocumented
/// <summary>
/// CUE-SDK: set specified LEDs to some colors.
/// This function set LEDs colors in the buffer which is written to the devices via CorsairSetLedsColorsFlushBuffer or CorsairSetLedsColorsFlushBufferAsync.
@ -151,7 +151,7 @@ namespace RGB.NET.Devices.Corsair.Native
/// This function executes synchronously, if you are concerned about delays consider using CorsairSetLedsColorsFlushBufferAsync
/// </summary>
internal static bool CorsairSetLedsColorsFlushBuffer() => _corsairSetLedsColorsFlushBufferPointer();
/// <summary>
/// CUE-SDK: get current color for the list of requested LEDs.
/// The color should represent the actual state of the hardware LED, which could be a combination of SDK and/or CUE input.
@ -175,7 +175,7 @@ namespace RGB.NET.Devices.Corsair.Native
/// CUE-SDK: returns information about device at provided index.
/// </summary>
internal static IntPtr CorsairGetDeviceInfo(int deviceIndex) => _corsairGetDeviceInfoPointer(deviceIndex);
/// <summary>
/// CUE-SDK: provides list of keyboard or mousepad LEDs with their physical positions.
/// </summary>

View File

@ -116,7 +116,10 @@ namespace RGB.NET.Devices.DMX
/// <inheritdoc />
public void Dispose()
{ }
{
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
}
#endregion
}

View File

@ -59,6 +59,15 @@ namespace RGB.NET.Devices.DMX.E131
/// <inheritdoc />
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate) => _updateQueue.SetData(ledsToUpdate.Where(x => x.Color.A > 0));
/// <inheritdoc />
public override void Dispose()
{
try { _updateQueue?.Dispose(); }
catch { /* at least we tried */ }
base.Dispose();
}
#endregion
}
}

View File

@ -70,6 +70,15 @@ namespace RGB.NET.Devices.Logitech
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(this, @"Layouts\Logitech", $"{layoutPath}.xml"), layout, true);
}
/// <inheritdoc />
public override void Dispose()
{
try { UpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
base.Dispose();
}
#endregion
}
}

View File

@ -182,7 +182,17 @@ namespace RGB.NET.Devices.Logitech
public void ResetDevices() => _LogitechGSDK.LogiLedRestoreLighting();
/// <inheritdoc />
public void Dispose() => _LogitechGSDK.LogiLedRestoreLighting();
public void Dispose()
{
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
try { _LogitechGSDK.LogiLedRestoreLighting(); }
catch { /* at least we tried */ }
try { _LogitechGSDK.UnloadLogitechGSDK(); }
catch { /* at least we tried */ }
}
#endregion
}

View File

@ -55,7 +55,7 @@ namespace RGB.NET.Devices.Logitech.Native
_logiLedSetLightingForTargetZonePointer = (LogiLedSetLightingForTargetZonePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "LogiLedSetLightingForTargetZone"), typeof(LogiLedSetLightingForTargetZonePointer));
}
private static void UnloadLogitechGSDK()
internal static void UnloadLogitechGSDK()
{
if (_dllHandle == IntPtr.Zero) return;

View File

@ -68,6 +68,15 @@ namespace RGB.NET.Devices.Msi
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate)
=> DeviceUpdateQueue.SetData(ledsToUpdate.Where(x => (x.Color.A > 0) && (x.CustomData is int)));
/// <inheritdoc />
public override void Dispose()
{
try { DeviceUpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
base.Dispose();
}
#endregion
}
}

View File

@ -163,7 +163,13 @@ namespace RGB.NET.Devices.Msi
/// <inheritdoc />
public void Dispose()
{ }
{
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
try { _MsiSDK.UnloadMsiSDK(); }
catch { /* at least we tried */ }
}
#endregion
}

View File

@ -60,7 +60,7 @@ namespace RGB.NET.Devices.Msi.Native
_getErrorMessagePointer = (GetErrorMessagePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "MLAPI_GetErrorMessage"), typeof(GetErrorMessagePointer));
}
private static void UnloadMsiSDK()
internal static void UnloadMsiSDK()
{
if (_dllHandle == IntPtr.Zero) return;

View File

@ -78,8 +78,11 @@ namespace RGB.NET.Devices.Novation
/// <inheritdoc cref="AbstractRGBDevice{TDeviceInfo}.Dispose" />
public override void Dispose()
{
try { UpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
Reset();
UpdateQueue.Dispose();
base.Dispose();
}

View File

@ -122,7 +122,10 @@ namespace RGB.NET.Devices.Novation
/// <inheritdoc />
public void Dispose()
{ }
{
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
}
#endregion
}

View File

@ -81,6 +81,15 @@ namespace RGB.NET.Devices.Razer
/// </summary>
public void Reset() => UpdateQueue.Reset();
/// <inheritdoc />
public override void Dispose()
{
try { UpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
base.Dispose();
}
#endregion
}
}

View File

@ -52,7 +52,7 @@ namespace RGB.NET.Devices.Razer.Native
_deleteEffectPointer = (DeleteEffectPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "DeleteEffect"), typeof(DeleteEffectPointer));
}
private static void UnloadRazerSDK()
internal static void UnloadRazerSDK()
{
if (_dllHandle == IntPtr.Zero) return;

View File

@ -222,7 +222,16 @@ namespace RGB.NET.Devices.Razer
}
/// <inheritdoc />
public void Dispose() => TryUnInit();
public void Dispose()
{
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
TryUnInit();
try { _RazerSDK.UnloadRazerSDK(); }
catch { /* at least we tried */ }
}
#endregion
}

View File

@ -27,11 +27,11 @@ namespace RGB.NET.Devices.Roccat.Native
/// </summary>
internal static void Reload()
{
UnloadCUESDK();
LoadCUESDK();
UnloadRoccatSDK();
LoadRoccatSDK();
}
private static void LoadCUESDK()
private static void LoadRoccatSDK()
{
if (_dllHandle != IntPtr.Zero) return;
@ -57,7 +57,7 @@ namespace RGB.NET.Devices.Roccat.Native
_setAllLedSfxPointer = (SetAllLedSfxPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "Set_all_LEDSFX"), typeof(SetAllLedSfxPointer));
}
private static void UnloadCUESDK()
internal static void UnloadRoccatSDK()
{
if (_dllHandle == IntPtr.Zero) return;

View File

@ -114,6 +114,9 @@ namespace RGB.NET.Devices.Roccat
try { _RoccatSDK.UnloadSDK(_sdkHandle); }
catch { /* We tried our best */}
}
try { _RoccatSDK.UnloadRoccatSDK(); }
catch { /* at least we tried */ }
}
#endregion

View File

@ -66,6 +66,9 @@ namespace RGB.NET.Devices.SoIP.Server
/// <inheritdoc />
public override void Dispose()
{
try { _updateQueue?.Dispose(); }
catch { /* at least we tried */ }
base.Dispose();
_tcpServer.Stop();

View File

@ -56,7 +56,7 @@ namespace RGB.NET.Devices.SoIP
{
if (_instance != null) throw new InvalidOperationException($"There can be only one instance of type {nameof(SoIPDeviceProvider)}");
_instance = this;
UpdateTrigger = new DeviceUpdateTrigger();
}
@ -130,8 +130,8 @@ namespace RGB.NET.Devices.SoIP
/// <inheritdoc />
public void Dispose()
{
foreach (IRGBDevice device in Devices)
device.Dispose();
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
}
#endregion

View File

@ -85,7 +85,9 @@ namespace RGB.NET.Devices.SteelSeries.API
internal static void Dispose()
{
ResetLeds();
if (IsInitialized)
ResetLeds();
_client.Dispose();
}

View File

@ -83,6 +83,15 @@ namespace RGB.NET.Devices.SteelSeries
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(this, @"Layouts\SteelSeries", $"{layoutPath}.xml"), layout, true);
}
/// <inheritdoc />
public override void Dispose()
{
try { UpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
base.Dispose();
}
#endregion
}
}

View File

@ -117,11 +117,11 @@ namespace RGB.NET.Devices.SteelSeries
/// <inheritdoc />
public void Dispose()
{
try
{
SteelSeriesSDK.Dispose();
}
catch {/* shit happens */}
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
try { SteelSeriesSDK.Dispose(); }
catch { /* shit happens */ }
}
#endregion

View File

@ -73,6 +73,15 @@ namespace RGB.NET.Devices.WS281X.Arduino
/// <inheritdoc />
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate) => UpdateQueue.SetData(ledsToUpdate.Where(x => x.Color.A > 0));
/// <inheritdoc />
public override void Dispose()
{
try { UpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
base.Dispose();
}
#endregion
}
}

View File

@ -39,7 +39,7 @@ namespace RGB.NET.Devices.WS281X.Arduino
/// <summary>
/// Initializes a new instance of the <see cref="ArduinoWS281XDeviceDefinition"/> class.
/// </summary>
/// <param name="portName">The name of the serial-port to connect to.</param>
/// <param name="port">The name of the serial-port to connect to.</param>
public ArduinoWS281XDeviceDefinition(string port)
{
this.Port = port;
@ -50,10 +50,8 @@ namespace RGB.NET.Devices.WS281X.Arduino
#region Methods
/// <inheritdoc />
public IEnumerable<IRGBDevice> CreateDevices()
public IEnumerable<IRGBDevice> CreateDevices(IDeviceUpdateTrigger updateTrigger)
{
DeviceUpdateTrigger updateTrigger = new DeviceUpdateTrigger();
ArduinoWS2812USBUpdateQueue queue = new ArduinoWS2812USBUpdateQueue(updateTrigger, Port, BaudRate);
IEnumerable<(int channel, int ledCount)> channels = queue.GetChannels();
int counter = 0;
@ -64,8 +62,6 @@ namespace RGB.NET.Devices.WS281X.Arduino
device.Initialize(ledCount);
yield return device;
}
updateTrigger.Start();
}
#endregion

View File

@ -63,6 +63,15 @@ namespace RGB.NET.Devices.WS281X.Bitwizard
/// <inheritdoc />
protected override void UpdateLeds(IEnumerable<Led> ledsToUpdate) => UpdateQueue.SetData(ledsToUpdate.Where(x => x.Color.A > 0));
/// <inheritdoc />
public override void Dispose()
{
try { UpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
base.Dispose();
}
#endregion
}
}

View File

@ -43,7 +43,7 @@ namespace RGB.NET.Devices.WS281X.Bitwizard
/// <summary>
/// Initializes a new instance of the <see cref="BitwizardWS281XDeviceDefinition"/> class.
/// </summary>
/// <param name="portName">The name of the serial-port to connect to.</param>
/// <param name="port">The name of the serial-port to connect to.</param>
public BitwizardWS281XDeviceDefinition(string port)
{
this.Port = port;
@ -54,17 +54,13 @@ namespace RGB.NET.Devices.WS281X.Bitwizard
#region Methods
/// <inheritdoc />
public IEnumerable<IRGBDevice> CreateDevices()
public IEnumerable<IRGBDevice> CreateDevices(IDeviceUpdateTrigger updateTrigger)
{
DeviceUpdateTrigger updateTrigger = new DeviceUpdateTrigger();
BitwizardWS2812USBUpdateQueue queue = new BitwizardWS2812USBUpdateQueue(updateTrigger, Port, BaudRate);
string name = Name ?? $"Bitwizard WS2812 USB ({Port})";
BitwizardWS2812USBDevice device = new BitwizardWS2812USBDevice(new BitwizardWS2812USBDeviceInfo(name), queue);
device.Initialize(StripLength);
yield return device;
updateTrigger.Start();
}
#endregion

View File

@ -13,6 +13,6 @@ namespace RGB.NET.Devices.WS281X
/// Gets the devices defined by this definition.
/// </summary>
/// <returns>The initialized devices defined by this definition.</returns>
IEnumerable<IRGBDevice> CreateDevices();
IEnumerable<IRGBDevice> CreateDevices(IDeviceUpdateTrigger updateTrigger);
}
}

View File

@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using RGB.NET.Core;
namespace RGB.NET.Devices.WS281X
@ -37,6 +38,11 @@ namespace RGB.NET.Devices.WS281X
// ReSharper disable once ReturnTypeCanBeEnumerable.Global
public List<IWS281XDeviceDefinition> DeviceDefinitions { get; } = new List<IWS281XDeviceDefinition>();
/// <summary>
/// The <see cref="DeviceUpdateTrigger"/> used to trigger the updates for corsair devices.
/// </summary>
public DeviceUpdateTrigger UpdateTrigger { get; }
#endregion
#region Constructors
@ -49,6 +55,8 @@ namespace RGB.NET.Devices.WS281X
{
if (_instance != null) throw new InvalidOperationException($"There can be only one instance of type {nameof(WS281XDeviceProvider)}");
_instance = this;
UpdateTrigger = new DeviceUpdateTrigger();
}
#endregion
@ -69,17 +77,20 @@ namespace RGB.NET.Devices.WS281X
try
{
UpdateTrigger?.Stop();
List<IRGBDevice> devices = new List<IRGBDevice>();
foreach (IWS281XDeviceDefinition deviceDefinition in DeviceDefinitions)
{
try
{
devices.AddRange(deviceDefinition.CreateDevices());
devices.AddRange(deviceDefinition.CreateDevices(UpdateTrigger));
}
catch { if (throwExceptions) throw; }
}
Devices = devices;
UpdateTrigger?.Start();
Devices = new ReadOnlyCollection<IRGBDevice>(devices);
IsInitialized = true;
}
catch
@ -99,10 +110,10 @@ namespace RGB.NET.Devices.WS281X
/// <inheritdoc />
public void Dispose()
{
if (IsInitialized)
foreach (IRGBDevice device in Devices)
if (device is IDisposable disposable)
disposable.Dispose();
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */}
DeviceDefinitions.Clear();
}
#endregion

View File

@ -63,6 +63,15 @@ namespace RGB.NET.Devices.Wooting.Generic
/// </summary>
protected abstract void InitializeLayout();
/// <inheritdoc />
public override void Dispose()
{
try { UpdateQueue?.Dispose(); }
catch { /* at least we tried */ }
base.Dispose();
}
#endregion
}
}

View File

@ -52,7 +52,7 @@ namespace RGB.NET.Devices.Wooting.Native
_arraySetSinglePointer = (ArraySetSinglePointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_array_set_single"), typeof(ArraySetSinglePointer));
}
private static void UnloadWootingSDK()
internal static void UnloadWootingSDK()
{
if (_dllHandle == IntPtr.Zero) return;
@ -91,13 +91,13 @@ namespace RGB.NET.Devices.Wooting.Native
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate IntPtr GetDeviceInfoPointer();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate bool KeyboardConnectedPointer();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate bool ResetPointer();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate bool ArrayUpdateKeyboardPointer();

View File

@ -28,13 +28,13 @@ namespace RGB.NET.Devices.Wooting
/// Gets a modifiable list of paths used to find the native SDK-dlls for x86 applications.
/// The first match will be used.
/// </summary>
public static List<string> PossibleX86NativePaths { get; } = new List<string> {"x86/wooting-rgb-sdk.dll"};
public static List<string> PossibleX86NativePaths { get; } = new List<string> { "x86/wooting-rgb-sdk.dll" };
/// <summary>
/// Gets a modifiable list of paths used to find the native SDK-dlls for x64 applications.
/// The first match will be used.
/// </summary>
public static List<string> PossibleX64NativePaths { get; } = new List<string> {"x64/wooting-rgb-sdk64.dll"};
public static List<string> PossibleX64NativePaths { get; } = new List<string> { "x64/wooting-rgb-sdk64.dll" };
/// <inheritdoc />
/// <summary>
@ -143,10 +143,14 @@ namespace RGB.NET.Devices.Wooting
/// <inheritdoc />
public void Dispose()
{
try { UpdateTrigger?.Dispose(); }
catch { /* at least we tried */ }
try { _WootingSDK.Reset(); }
catch
{ /* Unlucky.. */
}
catch { /* Unlucky.. */ }
try { _WootingSDK.UnloadWootingSDK(); }
catch { /* at least we tried */ }
}
#endregion