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 */
|
||||
_handlers.erase(
|
||||
std::remove_if(
|
||||
auto found = std::remove_if(
|
||||
_handlers.begin(),
|
||||
_handlers.end(),
|
||||
[earliest_tick](internal_event& element) -> bool {
|
||||
|
@ -110,9 +109,11 @@ void EventQueue::process_events() {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
),
|
||||
_handlers.end()
|
||||
);
|
||||
|
||||
if (found != _handlers.end()) {
|
||||
_handlers.erase(found, _handlers.end());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue