- stop recursion on destroy
authorBart Polot <bart@net.in.tum.de>
Mon, 21 Oct 2013 12:03:02 +0000 (12:03 +0000)
committerBart Polot <bart@net.in.tum.de>
Mon, 21 Oct 2013 12:03:02 +0000 (12:03 +0000)
src/mesh/gnunet-service-mesh_connection.c

index a36c57772125a7eb7b5e4cfb063b8b34d0184dd2..b15054a2b186b4779e8aa1c850573a760946b3b0 100644 (file)
@@ -1842,6 +1842,10 @@ GMC_destroy (struct MeshConnection *c)
   if (NULL == c)
     return;
 
+  if (2 == c->destroy) /* cancel queues -> GMP_queue_cancel -> q_destroy -> */
+    return;            /* -> message_sent -> GMC_destroy. Don't loop. */
+  c->destroy = 2;
+
   LOG (GNUNET_ERROR_TYPE_DEBUG, "destroying connection %s\n", GMC_2s (c));
 
   /* Cancel all traffic */