aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/ModLoader.cs
diff options
context:
space:
mode:
authorAlex Barney <thealexbarney@gmail.com>2021-12-23 09:55:50 -0700
committerGitHub <noreply@github.com>2021-12-23 13:55:50 -0300
commitaa932a6df1764b7c600ae0ba4e0c7a0ba802f312 (patch)
tree24a390cf2330620aeeab1efbd42ae4099f61ca86 /Ryujinx.HLE/HOS/ModLoader.cs
parentcb43cc7e322014ce2bd0ee73b06d403be62fa8d5 (diff)
Update to LibHac v0.14.3 (#2925)
* Update to LibHac v0.14.3 * Fix loading NCAs that don't have a data partition
Diffstat (limited to 'Ryujinx.HLE/HOS/ModLoader.cs')
-rw-r--r--Ryujinx.HLE/HOS/ModLoader.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Ryujinx.HLE/HOS/ModLoader.cs b/Ryujinx.HLE/HOS/ModLoader.cs
index f2f135f4..54a97556 100644
--- a/Ryujinx.HLE/HOS/ModLoader.cs
+++ b/Ryujinx.HLE/HOS/ModLoader.cs
@@ -15,6 +15,7 @@ using System.Linq;
using System.IO;
using Ryujinx.HLE.HOS.Kernel.Process;
using System.Globalization;
+using Path = System.IO.Path;
namespace Ryujinx.HLE.HOS
{
@@ -470,8 +471,10 @@ namespace Ryujinx.HLE.HOS
.Where(f => f.Type == DirectoryEntryType.File && !fileSet.Contains(f.FullPath))
.OrderBy(f => f.FullPath, StringComparer.Ordinal))
{
- baseRom.OpenFile(out IFile file, entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
- builder.AddFile(entry.FullPath, file);
+ using var file = new UniqueRef<IFile>();
+
+ baseRom.OpenFile(ref file.Ref(), entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
+ builder.AddFile(entry.FullPath, file.Release());
}
Logger.Info?.Print(LogClass.ModLoader, "Building new RomFS...");
@@ -487,10 +490,12 @@ namespace Ryujinx.HLE.HOS
.Where(f => f.Type == DirectoryEntryType.File)
.OrderBy(f => f.FullPath, StringComparer.Ordinal))
{
- fs.OpenFile(out IFile file, entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
+ using var file = new UniqueRef<IFile>();
+
+ fs.OpenFile(ref file.Ref(), entry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
if (fileSet.Add(entry.FullPath))
{
- builder.AddFile(entry.FullPath, file);
+ builder.AddFile(entry.FullPath, file.Release());
}
else
{