fix 1618
authorChristian Grothoff <christian@grothoff.org>
Fri, 19 Nov 2010 12:59:50 +0000 (12:59 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 19 Nov 2010 12:59:50 +0000 (12:59 +0000)
src/core/gnunet-service-core.c

index 5c2300bda4da13e41f9ed6d29b8949a94715c31c..1a43b46c351c809cfbf39c0db7f3825d053f922c 100644 (file)
@@ -4223,9 +4223,6 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Core service shutting down.\n");
 #endif
-  GNUNET_assert (transport != NULL);
-  GNUNET_TRANSPORT_disconnect (transport);
-  transport = NULL;
   while (NULL != (n = neighbours))
     {
       neighbours = n->next;
@@ -4233,6 +4230,9 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
       neighbour_count--;
       free_neighbour (n);
     }
+  GNUNET_assert (transport != NULL);
+  GNUNET_TRANSPORT_disconnect (transport);
+  transport = NULL;
   GNUNET_STATISTICS_set (stats, gettext_noop ("# neighbour entries allocated"), neighbour_count, GNUNET_NO);
   GNUNET_SERVER_notification_context_destroy (notifier);
   notifier = NULL;