Skip to content

Commit

Permalink
PINE: fix save state regression introduced during the switch to Qt
Browse files Browse the repository at this point in the history
Ensure thread safety when loading/saving state
  • Loading branch information
GovanifY authored and stenzek committed Jan 25, 2024
1 parent be208df commit 325e219
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pcsx2/PINE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-3.0+

#include "Common.h"
#include "Host.h"
#include "Memory.h"
#include "Elfheader.h"
#include "PINE.h"
Expand Down Expand Up @@ -623,7 +624,7 @@ PINEServer::IPCBuffer PINEServer::ParseCommand(std::span<u8> buf, std::vector<u8
goto error;
if (!SafetyChecks(buf_cnt, 1, ret_cnt, 0, buf_size)) [[unlikely]]
goto error;
VMManager::SaveStateToSlot(FromSpan<u8>(buf, buf_cnt));
Host::RunOnCPUThread([slot = FromSpan<u8>(buf, buf_cnt)] { VMManager::SaveStateToSlot(slot); });
buf_cnt += 1;
break;
}
Expand All @@ -633,7 +634,7 @@ PINEServer::IPCBuffer PINEServer::ParseCommand(std::span<u8> buf, std::vector<u8
goto error;
if (!SafetyChecks(buf_cnt, 1, ret_cnt, 0, buf_size)) [[unlikely]]
goto error;
VMManager::LoadStateFromSlot(FromSpan<u8>(buf, buf_cnt));
Host::RunOnCPUThread([slot = FromSpan<u8>(buf, buf_cnt)] { VMManager::LoadStateFromSlot(slot); });
buf_cnt += 1;
break;
}
Expand Down

0 comments on commit 325e219

Please sign in to comment.