diff options
Diffstat (limited to 'src/gnunet_chat_handle.c')
-rw-r--r-- | src/gnunet_chat_handle.c | 48 |
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) if (handle->messenger) GNUNET_MESSENGER_disconnect(handle->messenger); + struct GNUNET_CHAT_UriLookups *lookups; + while (handle->lookups_head) + { + lookups = handle->lookups_head; + + if (lookups->request) + GNUNET_GNS_lookup_cancel(lookups->request); + + if (lookups->uri) + uri_destroy(lookups->uri); + + GNUNET_CONTAINER_DLL_remove( + handle->lookups_head, + handle->lookups_tail, + lookups + ); + + GNUNET_free(lookups); + } + if (handle->gns) GNUNET_GNS_disconnect(handle->gns); + GNUNET_CONTAINER_multihashmap_iterate( + handle->files, it_destroy_handle_files, NULL + ); + if (handle->fs) GNUNET_FS_stop(handle->fs); @@ -322,10 +346,6 @@ handle_disconnect (struct GNUNET_CHAT_Handle *handle) handle->gns = NULL; handle->messenger = NULL; - GNUNET_CONTAINER_multihashmap_iterate( - handle->files, it_destroy_handle_files, NULL - ); - struct GNUNET_CHAT_InternalLobbies *lobbies; while (handle->lobbies_head) { @@ -343,26 +363,6 @@ handle_disconnect (struct GNUNET_CHAT_Handle *handle) GNUNET_free(lobbies); } - struct GNUNET_CHAT_UriLookups *lookups; - while (handle->lookups_head) - { - lookups = handle->lookups_head; - - if (lookups->request) - GNUNET_GNS_lookup_cancel(lookups->request); - - if (lookups->uri) - uri_destroy(lookups->uri); - - GNUNET_CONTAINER_DLL_remove( - handle->lookups_head, - handle->lookups_tail, - lookups - ); - - GNUNET_free(lookups); - } - GNUNET_CONTAINER_multihashmap_destroy(handle->groups); GNUNET_CONTAINER_multishortmap_destroy(handle->contacts); GNUNET_CONTAINER_multihashmap_destroy(handle->contexts); |