second commit lion review

This commit is contained in:
german77 2021-11-01 14:17:53 -06:00 committed by Narr the Reg
parent 730f078302
commit 77fa4d4bf6
28 changed files with 73 additions and 42 deletions

View file

@ -209,10 +209,11 @@ int EmulatedConsole::SetCallback(ConsoleUpdateCallback update_callback) {
void EmulatedConsole::DeleteCallback(int key) {
std::lock_guard lock{mutex};
if (!callback_list.contains(key)) {
const auto& iterator = callback_list.find(key);
if (iterator == callback_list.end()) {
LOG_ERROR(Input, "Tried to delete non-existent callback {}", key);
return;
}
callback_list.erase(key);
callback_list.erase(iterator);
}
} // namespace Core::HID