From f4f0fc75d3b88b492deab41df0a9a3bc7902027c Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Thu, 25 Jun 2015 03:32:25 +0000 Subject: - destroy queued messages only after making sure no channels have handles to them --- src/cadet/gnunet-service-cadet_tunnel.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index 422a1649e..6cda9f7ff 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c @@ -3657,9 +3657,6 @@ GCT_destroy (struct CadetTunnel *t) GNUNET_CONTAINER_multipeermap_remove (tunnels, GCP_get_id (t->peer), t)); - while (NULL != t->tq_head) - unqueue_data (t->tq_head); - for (iter_c = t->connection_head; NULL != iter_c; iter_c = next_c) { next_c = iter_c->next; @@ -3671,6 +3668,13 @@ GCT_destroy (struct CadetTunnel *t) GCCH_destroy (iter_ch->ch); /* Should only happen on shutdown, but it's ok. */ } + while (NULL != t->tq_head) + { + /* Should have been cleaned by destuction of channel. */ + GNUNET_break (0); + unqueue_data (t->tq_head); + } + if (NULL != t->destroy_task) { -- cgit v1.2.3