AchievementManager: Return by reference from GetLock()

This makes the API a little nicer to use, since you don't need to do
a mandatory dereference when passing the lock into any kind of scope
guard.
This commit is contained in:
Lioncash
2023-12-11 13:51:47 -05:00
parent 3c7fa0738c
commit d90537cc18
7 changed files with 9 additions and 9 deletions

View File

@ -731,9 +731,9 @@ void AchievementManager::AchievementEventHandler(const rc_runtime_event_t* runti
m_update_callback();
}
std::recursive_mutex* AchievementManager::GetLock()
std::recursive_mutex& AchievementManager::GetLock()
{
return &m_lock;
return m_lock;
}
bool AchievementManager::IsHardcoreModeActive() const
@ -934,7 +934,7 @@ void* AchievementManager::FilereaderOpenByVolume(const char* path_utf8)
auto state = std::make_unique<FilereaderState>();
{
auto& instance = GetInstance();
std::lock_guard lg{*instance.GetLock()};
std::lock_guard lg{instance.GetLock()};
state->volume = std::move(instance.GetLoadingVolume());
}
if (!state->volume)