From b4392db10975b23ed8aae0cd1977689688f0b0e6 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sun, 2 Jan 2011 17:29:30 -0500 Subject: [PATCH] Actually clean up waiters --- queue.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/queue.c b/queue.c index 0486875..e0ec2be 100644 --- a/queue.c +++ b/queue.c @@ -67,7 +67,12 @@ static void queue_destructor(node_t *n) { if (q != NULL) { /* can be NULL if queue_extend was given invalid args */ DECREF(q->name, sexp_destructor); DECREF(q->backlog_q, sexp_destructor); - /* q->waiter_q will be automatically destroyed as part of the destruction of q->subscriptions */ + { + subscription_t *sub = NULL; + while ((sub = dequeue(&q->waiter_q)) != NULL) { + free_subscription(sub); + } + } destroy_hashtable(&q->subscriptions); warn("TODO: the shovel needs to be taken down as well here\n"); free(q);