use NativeLibrary.TryLoad() instead of dllimported load

This commit is contained in:
UbitUmarov
2022-11-22 22:22:44 +00:00
parent dad22a822e
commit e5386fba6f

View File

@@ -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;