summaryrefslogtreecommitdiff
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.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/gnunet_chat_handle.c b/src/gnunet_chat_handle.c
index cbbbcc7..b9b1d3e 100644
--- a/src/gnunet_chat_handle.c
+++ b/src/gnunet_chat_handle.c
@@ -168,39 +168,32 @@ handle_destroy (struct GNUNET_CHAT_Handle *handle)
GNUNET_NAMESTORE_disconnect(handle->namestore);
struct GNUNET_CHAT_InternalAccounts *accounts;
- accounts = handle->accounts_head;
-
- while (accounts)
- {
- if (accounts->op)
- GNUNET_IDENTITY_cancel(accounts->op);
-
- accounts->op = NULL;
- accounts = accounts->next;
- }
-
- if (handle->identity)
- GNUNET_IDENTITY_disconnect(handle->identity);
-
- if (handle->arm)
- GNUNET_ARM_disconnect(handle->arm);
while (handle->accounts_head)
{
accounts = handle->accounts_head;
+ if (accounts->op)
+ GNUNET_IDENTITY_cancel(accounts->op);
+
if (accounts->account)
account_destroy(accounts->account);
GNUNET_CONTAINER_DLL_remove(
- handle->accounts_head,
- handle->accounts_tail,
- accounts
+ handle->accounts_head,
+ handle->accounts_tail,
+ accounts
);
GNUNET_free(accounts);
}
+ if (handle->identity)
+ GNUNET_IDENTITY_disconnect(handle->identity);
+
+ if (handle->arm)
+ GNUNET_ARM_disconnect(handle->arm);
+
if (handle->directory)
GNUNET_free(handle->directory);