second commit lion review
This commit is contained in:
parent
730f078302
commit
77fa4d4bf6
28 changed files with 73 additions and 42 deletions
|
@ -353,11 +353,12 @@ void InputEngine::SetMappingCallback(MappingCallback callback) {
|
|||
|
||||
void InputEngine::DeleteCallback(int key) {
|
||||
std::lock_guard lock{mutex_callback};
|
||||
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 InputCommon
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue