From 6036a6db55f684543f755df20983599a37164fb0 Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Tue, 26 Sep 2023 21:25:55 -0400 Subject: [PATCH] Updated AchievementManager StartRASession to properly lock inputs and outputs without locking during the network call. --- Source/Core/Core/AchievementManager.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/AchievementManager.cpp b/Source/Core/Core/AchievementManager.cpp index ed3729a738..e16d9bacc2 100644 --- a/Source/Core/Core/AchievementManager.cpp +++ b/Source/Core/Core/AchievementManager.cpp @@ -545,11 +545,16 @@ AchievementManager::ResolveHash(std::array game_hash) AchievementManager::ResponseType AchievementManager::StartRASession() { + rc_api_start_session_request_t start_session_request; rc_api_start_session_response_t session_data{}; - std::string username = Config::Get(Config::RA_USERNAME); - std::string api_token = Config::Get(Config::RA_API_TOKEN); - rc_api_start_session_request_t start_session_request = { - .username = username.c_str(), .api_token = api_token.c_str(), .game_id = m_game_id}; + std::string username, api_token; + { + std::lock_guard lg{m_lock}; + username = Config::Get(Config::RA_USERNAME); + api_token = Config::Get(Config::RA_API_TOKEN); + start_session_request = { + .username = username.c_str(), .api_token = api_token.c_str(), .game_id = m_game_id}; + } ResponseType r_type = Request( start_session_request, &session_data, rc_api_init_start_session_request, rc_api_process_start_session_response);