esp_event: iterate loop nodes safely as well

pull/4345/head
Renz Christian Bagaporo 2019-10-18 12:54:42 +08:00
rodzic 4c97906fc8
commit 3c253295eb
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -527,11 +527,11 @@ esp_err_t esp_event_loop_run(esp_event_loop_handle_t event_loop, TickType_t tick
bool exec = false;
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_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
SLIST_FOREACH_SAFE(handler, &(loop_node->handlers), next, temp_handler) {
handler_execute(loop, handler, post);