From 2bbecff220d664bafa023414547fad8ba22d1c4f Mon Sep 17 00:00:00 2001 From: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com> Date: Thu, 9 Oct 2025 21:23:05 +0200 Subject: [PATCH] Fix build --- LibreHardwareMonitorLib/Interop/IntelGcl.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LibreHardwareMonitorLib/Interop/IntelGcl.cs b/LibreHardwareMonitorLib/Interop/IntelGcl.cs index ca42d05..9fcade5 100644 --- a/LibreHardwareMonitorLib/Interop/IntelGcl.cs +++ b/LibreHardwareMonitorLib/Interop/IntelGcl.cs @@ -1,5 +1,6 @@ using System; using System.Runtime.InteropServices; +using Windows.Win32; namespace LibreHardwareMonitor.Interop; @@ -202,11 +203,10 @@ internal static class IntelGcl private static bool GclMethodExists(string gclMethod) { - IntPtr module = Kernel32.LoadLibrary(DllName); - if (module != IntPtr.Zero) + using FreeLibrarySafeHandle module = PInvoke.LoadLibrary(DllName); + if (!module.IsInvalid) { - bool result = Kernel32.GetProcAddress(module, gclMethod) != IntPtr.Zero; - Kernel32.FreeLibrary(module); + bool result = PInvoke.GetProcAddress(module, gclMethod) != IntPtr.Zero; return result; }