-fix
authorChristian Grothoff <christian@grothoff.org>
Tue, 24 Apr 2012 12:51:16 +0000 (12:51 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 24 Apr 2012 12:51:16 +0000 (12:51 +0000)
src/topology/gnunet-daemon-topology.c

index e7860ac9411cc0d3031c3609807be2f4c014f303..a9dbd3573bd2a03997f05a52071918ad74031127 100644 (file)
@@ -1186,11 +1186,6 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     GNUNET_PEERINFO_notify_cancel (peerinfo_notify);
     peerinfo_notify = NULL;
   }
-  if (GNUNET_SCHEDULER_NO_TASK != add_task)
-  {
-    GNUNET_SCHEDULER_cancel (add_task);
-    add_task = GNUNET_SCHEDULER_NO_TASK;
-  }
   GNUNET_TRANSPORT_disconnect (transport);
   transport = NULL;
   if (handle != NULL)
@@ -1199,6 +1194,11 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     handle = NULL;
   }
   whitelist_peers ();
+  if (GNUNET_SCHEDULER_NO_TASK != add_task)
+  {
+    GNUNET_SCHEDULER_cancel (add_task);
+    add_task = GNUNET_SCHEDULER_NO_TASK;
+  }
   GNUNET_CONTAINER_multihashmap_iterate (peers, &free_peer, NULL);
   GNUNET_CONTAINER_multihashmap_destroy (peers);
   peers = NULL;