1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

Fix hid_pad_handler

This commit is contained in:
RipleyTom 2023-03-10 14:05:08 +01:00 committed by Megamouse
parent 1b7b59466d
commit ec8cb1668c
2 changed files with 4 additions and 4 deletions

View File

@ -126,7 +126,7 @@ void hid_pad_handler<Device>::enumerate_devices()
{
Timer timer;
std::set<std::string> device_paths;
std::map<std::string, std::wstring_view> serials;
std::map<std::string, std::wstring> serials;
for (const auto& [vid, pid] : m_ids)
{
@ -140,7 +140,7 @@ void hid_pad_handler<Device>::enumerate_devices()
continue;
}
device_paths.insert(dev_info->path);
serials[dev_info->path] = dev_info->serial_number ? std::wstring_view(dev_info->serial_number) : std::wstring_view{};
serials[dev_info->path] = dev_info->serial_number ? std::wstring(dev_info->serial_number) : std::wstring();
dev_info = dev_info->next;
}
hid_free_enumeration(head);
@ -149,7 +149,7 @@ void hid_pad_handler<Device>::enumerate_devices()
std::lock_guard lock(m_enumeration_mutex);
m_new_enumerated_devices = device_paths;
m_enumerated_serials = serials;
m_enumerated_serials = std::move(serials);
}
template <class Device>

View File

@ -78,7 +78,7 @@ protected:
std::set<std::string> m_last_enumerated_devices;
std::set<std::string> m_new_enumerated_devices;
std::map<std::string, std::wstring_view> m_enumerated_serials;
std::map<std::string, std::wstring> m_enumerated_serials;
std::mutex m_enumeration_mutex;
std::unique_ptr<named_thread<std::function<void()>>> m_enumeration_thread;