AchievementManager: Call ActivateDeactivateLeaderboards() and ActivateDeactivateRichPresence() under lock.

Both of these functions access `m_game_data` and don't lock themselves, so they must be called in a way that guarantees that `m_game_data` is not modified during the call.
This commit is contained in:
Admiral H. Curtiss 2023-10-11 10:31:59 +02:00
parent 2677fd9a8e
commit 1645b1ed62
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 2 additions and 2 deletions

View File

@ -191,6 +191,8 @@ void AchievementManager::LoadGameByFilenameAsync(const std::string& iso_path,
m_is_game_loaded = true;
LoadUnlockData([](ResponseType r_type) {});
ActivateDeactivateAchievements();
ActivateDeactivateLeaderboards();
ActivateDeactivateRichPresence();
PointSpread spread = TallyScore();
if (hardcore_mode_enabled)
{
@ -209,8 +211,6 @@ void AchievementManager::LoadGameByFilenameAsync(const std::string& iso_path,
OSD::AddMessage("Hardcore mode is OFF", OSD::Duration::VERY_LONG, OSD::Color::CYAN);
}
}
ActivateDeactivateLeaderboards();
ActivateDeactivateRichPresence();
FetchBadges();
// Reset this to zero so that RP immediately triggers on the first frame
m_last_ping_time = 0;