aboutsummaryrefslogtreecommitdiff
path: root/src/gnunet_chat_handle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnunet_chat_handle.c')
-rw-r--r--src/gnunet_chat_handle.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/gnunet_chat_handle.c b/src/gnunet_chat_handle.c
index b9b1d3e..c5d70a8 100644
--- a/src/gnunet_chat_handle.c
+++ b/src/gnunet_chat_handle.c
@@ -312,9 +312,33 @@ handle_disconnect (struct GNUNET_CHAT_Handle *handle)
312 if (handle->messenger) 312 if (handle->messenger)
313 GNUNET_MESSENGER_disconnect(handle->messenger); 313 GNUNET_MESSENGER_disconnect(handle->messenger);
314 314
315 struct GNUNET_CHAT_UriLookups *lookups;
316 while (handle->lookups_head)
317 {
318 lookups = handle->lookups_head;
319
320 if (lookups->request)
321 GNUNET_GNS_lookup_cancel(lookups->request);
322
323 if (lookups->uri)
324 uri_destroy(lookups->uri);
325
326 GNUNET_CONTAINER_DLL_remove(
327 handle->lookups_head,
328 handle->lookups_tail,
329 lookups
330 );
331
332 GNUNET_free(lookups);
333 }
334
315 if (handle->gns) 335 if (handle->gns)
316 GNUNET_GNS_disconnect(handle->gns); 336 GNUNET_GNS_disconnect(handle->gns);
317 337
338 GNUNET_CONTAINER_multihashmap_iterate(
339 handle->files, it_destroy_handle_files, NULL
340 );
341
318 if (handle->fs) 342 if (handle->fs)
319 GNUNET_FS_stop(handle->fs); 343 GNUNET_FS_stop(handle->fs);
320 344
@@ -322,10 +346,6 @@ handle_disconnect (struct GNUNET_CHAT_Handle *handle)
322 handle->gns = NULL; 346 handle->gns = NULL;
323 handle->messenger = NULL; 347 handle->messenger = NULL;
324 348
325 GNUNET_CONTAINER_multihashmap_iterate(
326 handle->files, it_destroy_handle_files, NULL
327 );
328
329 struct GNUNET_CHAT_InternalLobbies *lobbies; 349 struct GNUNET_CHAT_InternalLobbies *lobbies;
330 while (handle->lobbies_head) 350 while (handle->lobbies_head)
331 { 351 {
@@ -343,26 +363,6 @@ handle_disconnect (struct GNUNET_CHAT_Handle *handle)
343 GNUNET_free(lobbies); 363 GNUNET_free(lobbies);
344 } 364 }
345 365
346 struct GNUNET_CHAT_UriLookups *lookups;
347 while (handle->lookups_head)
348 {
349 lookups = handle->lookups_head;
350
351 if (lookups->request)
352 GNUNET_GNS_lookup_cancel(lookups->request);
353
354 if (lookups->uri)
355 uri_destroy(lookups->uri);
356
357 GNUNET_CONTAINER_DLL_remove(
358 handle->lookups_head,
359 handle->lookups_tail,
360 lookups
361 );
362
363 GNUNET_free(lookups);
364 }
365
366 GNUNET_CONTAINER_multihashmap_destroy(handle->groups); 366 GNUNET_CONTAINER_multihashmap_destroy(handle->groups);
367 GNUNET_CONTAINER_multishortmap_destroy(handle->contacts); 367 GNUNET_CONTAINER_multishortmap_destroy(handle->contacts);
368 GNUNET_CONTAINER_multihashmap_destroy(handle->contexts); 368 GNUNET_CONTAINER_multihashmap_destroy(handle->contexts);