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); } }