mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-10 20:46:24 +00:00
Added native-unload to all deviceprovider-disposes
This commit is contained in:
1 parent
c98ffd2dbf
commit
1cfdeefde1
17 files changed
+60
-29
No files matched your search
@@ -182,7 +182,14 @@ namespace RGB.NET.Devices.Logitech
|
||||
public void ResetDevices() => _LogitechGSDK.LogiLedRestoreLighting();
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose() => _LogitechGSDK.LogiLedRestoreLighting();
|
||||
public void Dispose()
|
||||
{
|
||||
try { _LogitechGSDK.LogiLedRestoreLighting(); }
|
||||
catch { /* at least we tried */ }
|
||||
|
||||
try { _LogitechGSDK.UnloadLogitechGSDK(); }
|
||||
catch { /* at least we tried */ }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user