mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-31 15:32:38 +00:00
InputCommon/ControllerInterface: Make devices mutex recursive so RemoveDevice can be used within UpdateInput.
This commit is contained in:
parent
5af2081c75
commit
4176cc77e1
3 changed files with 11 additions and 10 deletions
|
@ -180,7 +180,7 @@ bool DeviceQualifier::operator!=(const DeviceQualifier& devq) const
|
|||
|
||||
std::shared_ptr<Device> DeviceContainer::FindDevice(const DeviceQualifier& devq) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_devices_mutex);
|
||||
std::lock_guard lk(m_devices_mutex);
|
||||
for (const auto& d : m_devices)
|
||||
{
|
||||
if (devq == d.get())
|
||||
|
@ -192,7 +192,7 @@ std::shared_ptr<Device> DeviceContainer::FindDevice(const DeviceQualifier& devq)
|
|||
|
||||
std::vector<std::string> DeviceContainer::GetAllDeviceStrings() const
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_devices_mutex);
|
||||
std::lock_guard lk(m_devices_mutex);
|
||||
|
||||
std::vector<std::string> device_strings;
|
||||
DeviceQualifier device_qualifier;
|
||||
|
@ -208,7 +208,7 @@ std::vector<std::string> DeviceContainer::GetAllDeviceStrings() const
|
|||
|
||||
std::string DeviceContainer::GetDefaultDeviceString() const
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(m_devices_mutex);
|
||||
std::lock_guard lk(m_devices_mutex);
|
||||
if (m_devices.empty())
|
||||
return "";
|
||||
|
||||
|
@ -226,7 +226,7 @@ Device::Input* DeviceContainer::FindInput(std::string_view name, const Device* d
|
|||
return inp;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lk(m_devices_mutex);
|
||||
std::lock_guard lk(m_devices_mutex);
|
||||
for (const auto& d : m_devices)
|
||||
{
|
||||
Device::Input* const i = d->FindInput(name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue