Improve a crash in disassembly on game shutdown.

This commit is contained in:
Unknown W. Brackets 2014-07-05 17:09:03 -07:00
parent e54893f1f1
commit 640c1231f3

View File

@ -315,9 +315,10 @@ void System_Wake() {
static bool pspIsInited = false;
static bool pspIsIniting = false;
static bool pspIsQuiting = false;
bool PSP_InitStart(const CoreParameter &coreParam, std::string *error_string) {
if (pspIsIniting) {
if (pspIsIniting || pspIsQuiting) {
return false;
}
@ -394,12 +395,12 @@ bool PSP_IsIniting() {
}
bool PSP_IsInited() {
return pspIsInited;
return pspIsInited && !pspIsQuiting;
}
void PSP_Shutdown() {
// Do nothing if we never inited.
if (!pspIsInited && !pspIsIniting) {
if (!pspIsInited && !pspIsIniting && !pspIsQuiting) {
return;
}
@ -409,6 +410,8 @@ void PSP_Shutdown() {
}
#endif
// Make sure things know right away that PSP memory, etc. is going away.
pspIsQuiting = true;
if (coreState == CORE_RUNNING)
Core_UpdateState(CORE_ERROR);
Core_NotifyShutdown();
@ -426,6 +429,7 @@ void PSP_Shutdown() {
currentMIPS = 0;
pspIsInited = false;
pspIsIniting = false;
pspIsQuiting = false;
}
void PSP_RunLoopUntil(u64 globalticks) {