diff --git a/ExternalHelpers/hidapi.net.dll b/ExternalHelpers/hidapi.net.dll index 54f1ddf..eafb757 100644 Binary files a/ExternalHelpers/hidapi.net.dll and b/ExternalHelpers/hidapi.net.dll differ diff --git a/PowerControl/Controller.cs b/PowerControl/Controller.cs index 0f56ce2..48b8cbe 100644 --- a/PowerControl/Controller.cs +++ b/PowerControl/Controller.cs @@ -1,18 +1,11 @@ using CommonHelpers; using ExternalHelpers; -using Microsoft.VisualBasic.Logging; -using Microsoft.Win32; +using hidapi; using PowerControl.External; using PowerControl.Helpers; using RTSSSharedMemoryNET; -using System; -using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using static System.Windows.Forms.AxHost; namespace PowerControl { @@ -201,7 +194,7 @@ namespace PowerControl updateOSD(); } - private void NeptuneDevice_OnInputReceived(object? sender, hidapi.HidDeviceInputReceivedEventArgs e) + private Task NeptuneDevice_OnInputReceived(hidapi.HidDeviceInputReceivedEventArgs e) { var input = SDCInput.FromBuffer(e.Buffer); @@ -224,6 +217,8 @@ namespace PowerControl // Consume only some events to avoid under-running SWICD if (!neptuneDeviceState.buttons5.HasFlag(SDCButton5.BTN_QUICK_ACCESS)) Thread.Sleep(50); + + return new Task(() => { }); } private void dismissNeptuneInput() diff --git a/SteamController/Devices/SteamController.cs b/SteamController/Devices/SteamController.cs index ac82ff9..87bf188 100644 --- a/SteamController/Devices/SteamController.cs +++ b/SteamController/Devices/SteamController.cs @@ -26,8 +26,15 @@ namespace SteamController.Devices stopwatch.Start(); } + ~SteamController() + { + Dispose(); + } + public void Dispose() { + GC.SuppressFinalize(this); + using (neptuneDevice) { } } public bool Updated { get; private set; }