fix
authorChristian Grothoff <christian@grothoff.org>
Tue, 31 May 2011 15:24:34 +0000 (15:24 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 31 May 2011 15:24:34 +0000 (15:24 +0000)
src/datastore/datastore_api.c

index 624d0cad7282b9057c9543ee27366ad251ce6adf..350c3563873c820b8c299441f1bfc1a4c76cb147 100644 (file)
@@ -315,6 +315,11 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h,
 {
   struct GNUNET_DATASTORE_QueueEntry *qe;
 
+  if (NULL != h->th)
+    {
+      GNUNET_CLIENT_notify_transmit_ready_cancel (h->th);
+      h->th = NULL;
+    }
   if (h->client != NULL)
     {
       GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
@@ -325,11 +330,6 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h,
       GNUNET_SCHEDULER_cancel (h->reconnect_task);
       h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
     }
-  if (NULL != h->th)
-    {
-      GNUNET_CLIENT_notify_transmit_ready_cancel (h->th);
-      h->th = NULL;
-    }
   while (NULL != (qe = h->queue_head))
     {
       GNUNET_assert (NULL != qe->response_proc);