Skip to content

Commit

Permalink
handle listeners events removing themselves
Browse files Browse the repository at this point in the history
  • Loading branch information
krichprollsch committed Apr 17, 2024
1 parent 6a7a00a commit 788fa60
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/events/event_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ dom_exception _dom_event_target_dispatch(dom_event_target *et,

evt->current = et;

bool ok = true;

do {
ok = le != eti->listeners;

if (dom_string_isequal(le->type, evt->type)) {
assert(le->listener->handler != NULL);

Expand All @@ -244,8 +248,7 @@ dom_exception _dom_event_target_dispatch(dom_event_target *et,
}
}

le = (struct listener_entry *) le->list.next;
} while (le != eti->listeners);
} while (ok);
}

if (evt->prevent_default == true)
Expand Down

0 comments on commit 788fa60

Please sign in to comment.