From 6cc350a4599ec6e4c27f18eb64d1aa765117d694 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 20 Oct 2024 12:41:52 +1000 Subject: [PATCH] Cheats: Serialize access to zips Prevents the UI thread from trashing the zip struct while the emulation thread is also reading. --- src/core/cheats.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/cheats.cpp b/src/core/cheats.cpp index 9a1bf28f8..0f948f5cc 100644 --- a/src/core/cheats.cpp +++ b/src/core/cheats.cpp @@ -228,6 +228,7 @@ const char* PATCHES_CONFIG_SECTION = "Patches"; const char* CHEATS_CONFIG_SECTION = "Cheats"; const char* PATCH_ENABLE_CONFIG_KEY = "Enable"; +static std::mutex s_zip_mutex; static CheatArchive s_patches_zip; static CheatArchive s_cheats_zip; static CheatCodeList s_patch_codes; @@ -365,6 +366,7 @@ void Cheats::EnumerateChtFiles(const std::string_view serial, std::optional