-clean up during shutdown
authorChristian Grothoff <christian@grothoff.org>
Sat, 16 Nov 2013 18:30:45 +0000 (18:30 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 16 Nov 2013 18:30:45 +0000 (18:30 +0000)
src/conversation/gnunet-service-conversation.c

index 08c93eb597804a6c24bc9ab04bc55470a7c64433..b12d0e193f96ae2594a7242dd8ec240d0be519b7 100644 (file)
@@ -1408,6 +1408,19 @@ static void
 do_shutdown (void *cls,
              const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
+  struct Line *line;
+  struct Channel *ch;
+
+  while (NULL != (line = lines_head))
+  {
+    while (NULL != (ch = line->channel_head))
+      destroy_line_mesh_channels (ch);
+    GNUNET_CONTAINER_DLL_remove (lines_head,
+                                 lines_tail,
+                                 line);
+    GNUNET_SERVER_client_set_user_context (line->client, (void *) NULL);
+    GNUNET_free (line);
+  }
   if (NULL != mesh)
   {
     GNUNET_MESH_disconnect (mesh);