esp_event: iterate loop nodes safely as well
This commit is contained in:
parent
9b16cb75f8
commit
0890ce9115
1 changed files with 2 additions and 2 deletions
|
@ -527,11 +527,11 @@ esp_err_t esp_event_loop_run(esp_event_loop_handle_t event_loop, TickType_t tick
|
||||||
bool exec = false;
|
bool exec = false;
|
||||||
|
|
||||||
esp_event_handler_instance_t *handler, *temp_handler;
|
esp_event_handler_instance_t *handler, *temp_handler;
|
||||||
esp_event_loop_node_t *loop_node;
|
esp_event_loop_node_t *loop_node, *temp_node;
|
||||||
esp_event_base_node_t *base_node, *temp_base;
|
esp_event_base_node_t *base_node, *temp_base;
|
||||||
esp_event_id_node_t *id_node, *temp_id_node;
|
esp_event_id_node_t *id_node, *temp_id_node;
|
||||||
|
|
||||||
SLIST_FOREACH(loop_node, &(loop->loop_nodes), next) {
|
SLIST_FOREACH_SAFE(loop_node, &(loop->loop_nodes), next, temp_node) {
|
||||||
// Execute loop level handlers
|
// Execute loop level handlers
|
||||||
SLIST_FOREACH_SAFE(handler, &(loop_node->handlers), next, temp_handler) {
|
SLIST_FOREACH_SAFE(handler, &(loop_node->handlers), next, temp_handler) {
|
||||||
handler_execute(loop, handler, post);
|
handler_execute(loop, handler, post);
|
||||||
|
|
Loading…
Reference in a new issue