summaryrefslogtreecommitdiff
path: root/src/ua.c
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2014-11-18 21:38:33 +0100
committerAlfred E. Heggestad <aeh@db.org>2014-11-18 21:38:33 +0100
commit20d56b74a75b5e4380e0aafbee09909495fd83b0 (patch)
treeefa6d7bdf558220b560231fb146f7ba0b363928e /src/ua.c
parent35f6874689cd9435a64760598398d1e499c20c71 (diff)
ua: make ua_event(), allow handlers to unregister itself
Diffstat (limited to 'src/ua.c')
-rw-r--r--src/ua.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ua.c b/src/ua.c
index ec472f3..b4f5f9c 100644
--- a/src/ua.c
+++ b/src/ua.c
@@ -120,9 +120,10 @@ void ua_event(struct ua *ua, enum ua_event ev, struct call *call,
va_end(ap);
/* send event to all clients */
- for (le = uag.ehl.head; le; le = le->next) {
-
+ le = uag.ehl.head;
+ while (le) {
struct ua_eh *eh = le->data;
+ le = le->next;
eh->h(ua, ev, call, buf, eh->arg);
}