mirror of https://github.com/ARMmbed/mbed-os.git
Fix fake event queue process event.
The result of remove_if was fed into erase without checking something was actually removed.pull/14254/head
parent
0feaae6d18
commit
a3a507d9ca
|
@ -98,8 +98,7 @@ void EventQueue::process_events() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dispatch all handlers that happen at this time */
|
/* dispatch all handlers that happen at this time */
|
||||||
_handlers.erase(
|
auto found = std::remove_if(
|
||||||
std::remove_if(
|
|
||||||
_handlers.begin(),
|
_handlers.begin(),
|
||||||
_handlers.end(),
|
_handlers.end(),
|
||||||
[earliest_tick](internal_event& element) -> bool {
|
[earliest_tick](internal_event& element) -> bool {
|
||||||
|
@ -110,9 +109,11 @@ void EventQueue::process_events() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
),
|
|
||||||
_handlers.end()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (found != _handlers.end()) {
|
||||||
|
_handlers.erase(found, _handlers.end());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue