summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ua.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ua.c b/src/ua.c
index 461d223..45102e4 100644
--- a/src/ua.c
+++ b/src/ua.c
@@ -207,7 +207,8 @@ void ua_unregister(struct ua *ua)
if (!ua)
return;
- ua_event(ua, UA_EVENT_UNREGISTERING, NULL, NULL);
+ if (!list_isempty(&ua->regl))
+ ua_event(ua, UA_EVENT_UNREGISTERING, NULL, NULL);
for (le = ua->regl.head; le; le = le->next) {
struct reg *reg = le->data;
@@ -506,7 +507,8 @@ static void ua_destructor(void *arg)
list_unlink(&ua->le);
- ua_event(ua, UA_EVENT_UNREGISTERING, NULL, NULL);
+ if (!list_isempty(&ua->regl))
+ ua_event(ua, UA_EVENT_UNREGISTERING, NULL, NULL);
list_flush(&ua->calls);
list_flush(&ua->regl);