Skip to content

Commit

Permalink
Core: Correct shutdown on late init failure.
Browse files Browse the repository at this point in the history
Otherwise we leak and can't start again.  This happened when shutdown
completed quickly after thread start.
  • Loading branch information
unknownbrackets committed Aug 13, 2022
1 parent ade8b88 commit 9bda04a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Core/System.cpp
Expand Up @@ -447,7 +447,9 @@ bool PSP_InitStart(const CoreParameter &coreParam, std::string *error_string) {
bool success = !g_CoreParameter.fileToStart.empty();
if (!success) {
Core_NotifyLifecycle(CoreLifecycle::START_COMPLETE);
pspIsIniting = false;
// In this case, we must call shutdown since the caller won't know to.
// It must've partially started since CPU_Init returned true.
PSP_Shutdown();
}
return success;
}
Expand Down

0 comments on commit 9bda04a

Please sign in to comment.