summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
index 0cae47c741..afdf768435 100644
--- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
@@ -322,7 +322,9 @@ void ControllerInterface::UnregisterDevicesChangedCallback(const HotplugCallback
// Invoke all callbacks that were registered
void ControllerInterface::InvokeDevicesChangedCallbacks() const
{
- std::lock_guard<std::mutex> lk(m_callbacks_mutex);
- for (const auto& callback : m_devices_changed_callbacks)
+ m_callbacks_mutex.lock();
+ const auto devices_changed_callbacks = m_devices_changed_callbacks;
+ m_callbacks_mutex.unlock();
+ for (const auto& callback : devices_changed_callbacks)
callback();
}