Debugger: Fixed deadlock when trying to reset game just as it is about to crash (STP/HLT opcode)

This commit is contained in:
Souryo 2017-08-05 14:24:44 -04:00
parent 2753273206
commit fb5bf36c91

View file

@ -248,11 +248,13 @@ void Console::Reset(bool softReset)
SoundMixer::StopRecording(); SoundMixer::StopRecording();
Console::Pause(); Console::Pause();
if(softReset) { if(Instance->_initialized) {
Instance->ResetComponents(softReset); if(softReset) {
} else { Instance->ResetComponents(softReset);
//Full reset of all objects to ensure the emulator always starts in the exact same state } else {
LoadROM(Instance->_romFilepath, Instance->_patchFilename); //Full reset of all objects to ensure the emulator always starts in the exact same state
LoadROM(Instance->_romFilepath, Instance->_patchFilename);
}
} }
Console::Resume(); Console::Resume();
} }
@ -439,8 +441,6 @@ void Console::Run()
SaveStateManager::SaveRecentGame(_mapper->GetRomName(), _romFilepath, _patchFilename); SaveStateManager::SaveRecentGame(_mapper->GetRomName(), _romFilepath, _patchFilename);
} }
MessageManager::SendNotification(ConsoleNotificationType::GameStopped);
_rewindManager.reset(); _rewindManager.reset();
SoundMixer::StopAudio(); SoundMixer::StopAudio();
MovieManager::Stop(); MovieManager::Stop();
@ -472,6 +472,8 @@ void Console::Run()
_stopLock.Release(); _stopLock.Release();
_runLock.Release(); _runLock.Release();
MessageManager::SendNotification(ConsoleNotificationType::GameStopped);
} }
bool Console::IsRunning() bool Console::IsRunning()