fix #1826
authorChristian Grothoff <christian@grothoff.org>
Thu, 20 Oct 2011 11:19:04 +0000 (11:19 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 20 Oct 2011 11:19:04 +0000 (11:19 +0000)
src/core/gnunet-service-core_neighbours.c

index 505b1797b0f7b7fa0f4e8f8dc633a4343066755a..596836216364d7b8e14589042b045a33d2985811 100644 (file)
@@ -502,6 +502,8 @@ free_neighbour_helper (void *cls, const GNUNET_HashCode * key, void *value)
 {
   struct Neighbour *n = value;
 
+  /* transport should have 'disconnected' all neighbours... */
+  GNUNET_break (0);
   free_neighbour (n);
   return GNUNET_OK;
 }
@@ -515,10 +517,10 @@ GSC_NEIGHBOURS_done ()
 {
   if (NULL == transport)
     return;
-  GNUNET_CONTAINER_multihashmap_iterate (neighbours, &free_neighbour_helper,
-                                         NULL);
   GNUNET_TRANSPORT_disconnect (transport);
   transport = NULL;
+  GNUNET_CONTAINER_multihashmap_iterate (neighbours, &free_neighbour_helper,
+                                         NULL);
   GNUNET_CONTAINER_multihashmap_destroy (neighbours);
   neighbours = NULL;
 }