Stop "messages from java" to leak out to NativeMessageReceived except where explicitly allowed

This commit is contained in:
Henrik Rydgård committed 2023-07-06 17:13:04 +02:00
1 parent c3d7074e30
commit ac4506e389
10 files changed
+42 -34

No files matched your search

+3
View File
@@ -780,6 +780,7 @@ bool HasBuiltinController(const std::string &name) {
}
void NotifyPadConnected(InputDeviceID deviceId, const std::string &name) {
std::lock_guard<std::recursive_mutex> guard(g_controllerMapLock);
g_seenPads.insert(name);
g_padNames[deviceId] = name;
}
@@ -812,10 +813,12 @@ void AutoConfForPad(const std::string &name) {
}
const std::set<std::string> &GetSeenPads() {
std::lock_guard<std::recursive_mutex> guard(g_controllerMapLock);
return g_seenPads;
}
std::string PadName(InputDeviceID deviceId) {
std::lock_guard<std::recursive_mutex> guard(g_controllerMapLock);
auto it = g_padNames.find(deviceId);
if (it != g_padNames.end())
return it->second;