Make KernelState::TerminateTitle try to terminate XThreads safely.
This commit is contained in:
@@ -358,8 +358,6 @@ bool Emulator::SaveToFile(const std::wstring& path) {
|
||||
}
|
||||
|
||||
bool Emulator::RestoreFromFile(const std::wstring& path) {
|
||||
auto lock = global_critical_region::AcquireDirect();
|
||||
|
||||
// Restore the emulator state from a file
|
||||
auto map = MappedMemory::Open(path, MappedMemory::Mode::kReadWrite);
|
||||
if (!map) {
|
||||
@@ -372,6 +370,7 @@ bool Emulator::RestoreFromFile(const std::wstring& path) {
|
||||
Pause();
|
||||
kernel_state_->TerminateTitle();
|
||||
|
||||
auto lock = global_critical_region::AcquireDirect();
|
||||
ByteStream stream(map->data(), map->size());
|
||||
if (stream.Read<uint32_t>() != 'XSAV') {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user