Fix hang when changing UMD with retroachievements enabled

Fixes #17976
This commit is contained in:
Henrik Rydgård committed 2023-09-12 14:17:50 +02:00
1 parent 95badd03b4
commit 1f60247749
5 files changed
+42 -9

No files matched your search

+3 -2
View File
@@ -385,7 +385,7 @@ bool LoadFile(FileLoader **fileLoaderPtr, std::string *error_string) {
return false;
}
bool UmdReplace(const Path &filepath, std::string &error) {
bool UmdReplace(const Path &filepath, FileLoader **fileLoader, std::string &error) {
IFileSystem *currentUMD = pspFileSystem.GetSystem("disc0:");
if (!currentUMD) {
@@ -404,6 +404,8 @@ bool UmdReplace(const Path &filepath, std::string &error) {
loadedFile = ResolveFileLoaderTarget(loadedFile);
*fileLoader = loadedFile;
std::string errorString;
IdentifiedFileType type = Identify_File(loadedFile, &errorString);
@@ -415,7 +417,6 @@ bool UmdReplace(const Path &filepath, std::string &error) {
error = "reinit memory failed";
return false;
}
break;
default:
error = "Unsupported file type: " + std::to_string((int)type) + " " + errorString;