Merge pull request #8518 from stenzek/more-wiimote-reset-crashes

Core: Reset Wiimotes/rumble/memwatcher on emu thread
This commit is contained in:
Connor McLaughlin 2019-12-13 13:44:22 +10:00 committed by GitHub
commit a980a39807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -289,15 +289,6 @@ void Stop() // - Hammertime!
g_video_backend->Video_ExitLoop();
}
if (_CoreParameter.bWii)
Wiimote::ResetAllWiimotes();
ResetRumble();
#ifdef USE_MEMORYWATCHER
s_memory_watcher.reset();
#endif
}
void DeclareAsCPUThread()
@ -374,6 +365,10 @@ static void CpuThread(const std::optional<std::string>& savestate_path, bool del
// Enter CPU run loop. When we leave it - we are done.
CPU::Run();
#ifdef USE_MEMORYWATCHER
s_memory_watcher.reset();
#endif
s_is_started = false;
if (_CoreParameter.bFastmem)
@ -533,7 +528,12 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
return;
if (init_wiimotes)
{
Wiimote::ResetAllWiimotes();
Wiimote::Shutdown();
}
ResetRumble();
Keyboard::Shutdown();
Pad::Shutdown();