From e5386fba6f878618eef31a447a694ad63e3fcfc5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 22 Nov 2022 22:22:44 +0000 Subject: [PATCH] use NativeLibrary.TryLoad() instead of dllimported load --- OpenSim/Framework/Util.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 8cce8216da..8d78fd6193 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -55,7 +55,6 @@ using OpenMetaverse; using OpenMetaverse.StructuredData; using Amib.Threading; using System.Collections.Concurrent; -using System.Reflection.Metadata; namespace OpenSim.Framework { @@ -1098,7 +1097,7 @@ namespace OpenSim.Framework m_log.Debug($"[UTIL]: Loading native Windows library at {nativeLibraryPath}"); - if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero) + if (!NativeLibrary.TryLoad(nativeLibraryPath, out _)) { m_log.Error($"[UTIL]: Couldn't find native Windows library at {nativeLibraryPath}"); return false;