From 5df0c58c81807273dc934a43519f07f940ad25cb Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 5 Jan 2011 12:39:36 -0500 Subject: [PATCH] Warn about shovel only when one exists --- queue.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/queue.c b/queue.c index 3017538..0567415 100644 --- a/queue.c +++ b/queue.c @@ -61,7 +61,12 @@ static void queue_destructor(node_t *n) { } } destroy_hashtable(&q->subscriptions); - warn("TODO: the shovel needs to be taken down as well here\n"); + if (q->shovel) { + warn("TODO: the shovel needs to be taken down as well here\n"); + /* The difficulty is that the shovel may be running at the + moment, so careful ordering of operations is required to + avoid referencing deallocated memory. */ + } free(q); } }