From 5954f4cbe01c78fff5a5242e8ff91c0a1c65c4e1 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Tue, 3 May 2016 18:38:43 +0000 Subject: [PATCH] Fix shutdown assertion failure in core_api: avoid double cancel of pending traffic --- src/cadet/gnunet-service-cadet_peer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 46961250b..ee8f9652f 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c @@ -775,8 +775,6 @@ peer_destroy (struct CadetPeer *peer) GNUNET_assert (0 == GNUNET_CONTAINER_multihashmap_size (peer->connections)); GNUNET_CONTAINER_multihashmap_destroy (peer->connections); } - if (NULL != peer->core_transmit) - GNUNET_CORE_notify_transmit_ready_cancel (peer->core_transmit); if (NULL != peer->hello_offer) { GNUNET_TRANSPORT_offer_hello_cancel (peer->hello_offer); @@ -791,6 +789,13 @@ peer_destroy (struct CadetPeer *peer) { GCP_queue_destroy (peer->queue_head, GNUNET_YES, GNUNET_NO, 0); } + if (NULL != peer->core_transmit) + { + GNUNET_break (0); /* GCP_queue_destroy should've cancelled it! */ + GNUNET_CORE_notify_transmit_ready_cancel (peer->core_transmit); + peer->core_transmit = NULL; + } + GNUNET_free_non_null (peer->hello); GNUNET_free (peer); return GNUNET_OK; -- 2.25.1