Release Achievement Manager Loaded Volume

AchievementManager maintains a unique pointer to a copy of the current volume so it can asynchronously hash that volume. It is not needed otherwise, so I can release that pointer when hashing is complete. This change fixes a bug whereby changing discs in a game and then changing to a different game would result in the loaded volume pointer still being loaded with and hashing to the previous game.
This commit is contained in:
LillyJadeKatrin 2024-06-11 07:03:17 -04:00
parent 222a393080
commit d18dc1785d
1 changed files with 2 additions and 0 deletions

View File

@ -642,6 +642,7 @@ void AchievementManager::LeaderboardEntriesCallback(int result, const char* erro
void AchievementManager::LoadGameCallback(int result, const char* error_message,
rc_client_t* client, void* userdata)
{
AchievementManager::GetInstance().m_loading_volume.reset(nullptr);
if (result != RC_OK)
{
WARN_LOG_FMT(ACHIEVEMENTS, "Failed to load data for current game.");
@ -672,6 +673,7 @@ void AchievementManager::LoadGameCallback(int result, const char* error_message,
void AchievementManager::ChangeMediaCallback(int result, const char* error_message,
rc_client_t* client, void* userdata)
{
AchievementManager::GetInstance().m_loading_volume.reset(nullptr);
if (result == RC_OK)
return;