From 50869782ff2eb667bf028fc5da069999b4ee863a Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Tue, 3 Jul 2012 13:40:54 +0000 Subject: [PATCH] -clearing LCFContext queue on shutdown --- src/testbed/gnunet-service-testbed.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index cfc70433f..c42805fff 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c @@ -893,6 +893,7 @@ static void shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { + struct LCFContextQueue *lcfq; uint32_t host_id; uint32_t route_id; @@ -907,6 +908,24 @@ shutdown_task (void *cls, GNUNET_DISK_file_close (fh); fh = NULL; } + if (NULL != lcfq_head) + { + if (GNUNET_SCHEDULER_NO_TASK != lcf_proc_task_id) + { + GNUNET_SCHEDULER_cancel (lcf_proc_task_id); + lcf_proc_task_id = GNUNET_SCHEDULER_NO_TASK; + } + if (NULL != lcfq_head->lcf->rhandle) + GNUNET_TESTBED_cancel_registration (lcfq_head->lcf->rhandle); + } + GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id); + for (lcfq = lcfq_head; NULL != lcfq; lcfq = lcfq_head) + { + GNUNET_CONFIGURATION_destroy (lcfq->lcf->cfg); + GNUNET_free (lcfq->lcf); + GNUNET_CONTAINER_DLL_remove (lcfq_head, lcfq_tail, lcfq); + GNUNET_free (lcfq); + } /* Clear host list */ for (host_id = 0; host_id < host_list_size; host_id++) if (NULL != host_list[host_id]) -- 2.25.1