mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-10 21:16:24 +02:00
Core: Wait for background CPU load on exit.
This prevents crashes when exiting a game while loading is still in progress. See #11516.
This commit is contained in:
1 parent
5ea935f4bf
commit
670e207c57
5 files changed
+41
-1
No files matched your search
@@ -82,6 +82,9 @@ ParamSFOData g_paramSFO;
|
||||
static GlobalUIState globalUIState;
|
||||
static CoreParameter coreParameter;
|
||||
static FileLoader *loadedFile;
|
||||
// For background loading thread.
|
||||
static std::mutex loadingLock;
|
||||
// For loadingReason updates.
|
||||
static std::mutex loadingReasonLock;
|
||||
static std::string loadingReason;
|
||||
|
||||
@@ -255,7 +258,18 @@ void CPU_Init() {
|
||||
}
|
||||
}
|
||||
|
||||
PSP_LoadingLock::PSP_LoadingLock() {
|
||||
loadingLock.lock();
|
||||
}
|
||||
|
||||
PSP_LoadingLock::~PSP_LoadingLock() {
|
||||
loadingLock.unlock();
|
||||
}
|
||||
|
||||
void CPU_Shutdown() {
|
||||
// Since we load on a background thread, wait for startup to complete.
|
||||
PSP_LoadingLock lock;
|
||||
|
||||
if (g_Config.bAutoSaveSymbolMap) {
|
||||
host->SaveSymbolMap();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user