aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Guillemard <thog@protonmail.com>2018-07-19 20:44:52 +0200
committergdkchan <gab.dark.100@gmail.com>2018-07-19 15:44:52 -0300
commitc9fc52edb6abc014d5d5671c1634b01ace48de2f (patch)
tree3f6762a8c10cd235d24b9b1bbe8bd3b99dfd3ac9
parent8b67297711003dfac432acb3278c5a406617e662 (diff)
Fix SystemPathToSwitchPath platform issues and make sure to delete temporary NRO after sessions dispose (#293)
-rw-r--r--Ryujinx.HLE/OsHle/Horizon.cs1
-rw-r--r--Ryujinx.HLE/OsHle/Process.cs10
-rw-r--r--Ryujinx.HLE/VirtualFileSystem.cs4
3 files changed, 7 insertions, 8 deletions
diff --git a/Ryujinx.HLE/OsHle/Horizon.cs b/Ryujinx.HLE/OsHle/Horizon.cs
index 9d8a937f..70ae24be 100644
--- a/Ryujinx.HLE/OsHle/Horizon.cs
+++ b/Ryujinx.HLE/OsHle/Horizon.cs
@@ -96,7 +96,6 @@ namespace Ryujinx.HLE.OsHle
if (IsNro && (SwitchFilePath == null || !SwitchFilePath.StartsWith("sdmc:/")))
{
- // TODO: avoid copying the file if we are already inside a sdmc directory
string SwitchPath = $"sdmc:/switch/{Name}{Homebrew.TemporaryNroSuffix}";
string TempPath = Ns.VFs.SwitchPathToSystemPath(SwitchPath);
diff --git a/Ryujinx.HLE/OsHle/Process.cs b/Ryujinx.HLE/OsHle/Process.cs
index be27dcc2..c7606dc9 100644
--- a/Ryujinx.HLE/OsHle/Process.cs
+++ b/Ryujinx.HLE/OsHle/Process.cs
@@ -403,11 +403,6 @@ namespace Ryujinx.HLE.OsHle
{
if (Disposing && !Disposed)
{
- if (NeedsHbAbi && Executables[0].FilePath.EndsWith(Homebrew.TemporaryNroSuffix))
- {
- File.Delete(Executables[0].FilePath);
- }
-
//If there is still some thread running, disposing the objects is not
//safe as the thread may try to access those resources. Instead, we set
//the flag to have the Process disposed when all threads finishes.
@@ -431,6 +426,11 @@ namespace Ryujinx.HLE.OsHle
}
}
+ if (NeedsHbAbi && Executables.Count > 0 && Executables[0].FilePath.EndsWith(Homebrew.TemporaryNroSuffix))
+ {
+ File.Delete(Executables[0].FilePath);
+ }
+
INvDrvServices.UnloadProcess(this);
AppletState.Dispose();
diff --git a/Ryujinx.HLE/VirtualFileSystem.cs b/Ryujinx.HLE/VirtualFileSystem.cs
index 38df81f8..df1fc9db 100644
--- a/Ryujinx.HLE/VirtualFileSystem.cs
+++ b/Ryujinx.HLE/VirtualFileSystem.cs
@@ -57,11 +57,11 @@ namespace Ryujinx.HLE
public string SystemPathToSwitchPath(string SystemPath)
{
- string BaseSystemPath = GetBasePath() + "/";
+ string BaseSystemPath = GetBasePath() + Path.DirectorySeparatorChar;
if (SystemPath.StartsWith(BaseSystemPath))
{
string RawPath = SystemPath.Replace(BaseSystemPath, "");
- int FirstSeparatorOffset = RawPath.IndexOf('/');
+ int FirstSeparatorOffset = RawPath.IndexOf(Path.DirectorySeparatorChar);
if (FirstSeparatorOffset == -1)
{
return $"{RawPath}:/";