-do not leave th non-NULL on reconnect
authorChristian Grothoff <christian@grothoff.org>
Tue, 24 Jan 2012 20:11:33 +0000 (20:11 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 24 Jan 2012 20:11:33 +0000 (20:11 +0000)
src/mesh/mesh_api.c

index 4f733c1d3b10a9dfa1abd83d84d8efd9e1cb86fb..0638f9f851f2b8fda6df35bb4718bf1b5217c7db 100644 (file)
@@ -663,6 +663,7 @@ reconnect (struct GNUNET_MESH_Handle *h)
   if (NULL != h->th)
   {
     GNUNET_CLIENT_notify_transmit_ready_cancel (h->th);
+    h->th = NULL;
   }
   if (NULL != h->client)
   {
@@ -1333,10 +1334,12 @@ GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle)
   if (NULL != handle->th)
   {
     GNUNET_CLIENT_notify_transmit_ready_cancel (handle->th);
+    handle->th = NULL;
   }
   if (NULL != handle->client)
   {
     GNUNET_CLIENT_disconnect (handle->client, GNUNET_NO);
+    handle->client = NULL;
   }
   GNUNET_free (handle);
 }