From 8c6bb1b5204abf35ea7c2e99586e6a8d067e4b95 Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Wed, 11 Sep 2024 10:10:38 -0400 Subject: [PATCH] chore: Adjust for errors --- src/Resizetizer/src/SkiaSharpTools.Initializer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Resizetizer/src/SkiaSharpTools.Initializer.cs b/src/Resizetizer/src/SkiaSharpTools.Initializer.cs index 98d06a9..f2a9be7 100644 --- a/src/Resizetizer/src/SkiaSharpTools.Initializer.cs +++ b/src/Resizetizer/src/SkiaSharpTools.Initializer.cs @@ -196,7 +196,7 @@ static IntPtr ImportResolver(string libraryName, Assembly assembly, DllImportSea if (libraryName.Equals("libHarfBuzzSharp", StringComparison.OrdinalIgnoreCase) || libraryName.Equals("HarfBuzzSharp", StringComparison.OrdinalIgnoreCase)) { - if (!LinuxTryLoad("libHarfBuzzSharp.dll") + if (!LinuxTryLoad("libHarfBuzzSharp.dll", out libHandle) && !_tryLoad("libHarfBuzzSharp.dll", typeof(SkiaSharpTools).Assembly, searchFlags, out libHandle)) { throw new InvalidOperationException($"Failed to load libHarfBuzzSharp"); @@ -206,8 +206,8 @@ static IntPtr ImportResolver(string libraryName, Assembly assembly, DllImportSea if (libraryName.Equals("libSkiaSharp", StringComparison.OrdinalIgnoreCase) || libraryName.Equals("SkiaSharp", StringComparison.OrdinalIgnoreCase)) { - if (!LinuxTryLoad("libSkiaSharp.dll") - !_tryLoad("libSkiaSharp.dll", typeof(SkiaSharpTools).Assembly, searchFlags, out libHandle)) + if (!LinuxTryLoad("libSkiaSharp.dll", out libHandle) + && !_tryLoad("libSkiaSharp.dll", typeof(SkiaSharpTools).Assembly, searchFlags, out libHandle)) { throw new InvalidOperationException($"Failed to load libSkiaSharp"); } @@ -227,7 +227,7 @@ bool LinuxTryLoad(string path, out IntPtr handle) } } } - + handle = IntPtr.Zero; return false; }