mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
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:
@ -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)
|
||||
|
Reference in New Issue
Block a user