diff options
Diffstat (limited to 'src/gnunet_chat_handle.c')
-rw-r--r-- | src/gnunet_chat_handle.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/gnunet_chat_handle.c b/src/gnunet_chat_handle.c index d23741b..cbbbcc7 100644 --- a/src/gnunet_chat_handle.c +++ b/src/gnunet_chat_handle.c | |||
@@ -40,6 +40,8 @@ handle_create_from_config (const struct GNUNET_CONFIGURATION_Handle* cfg, | |||
40 | on_handle_shutdown, handle | 40 | on_handle_shutdown, handle |
41 | ); | 41 | ); |
42 | 42 | ||
43 | handle->destruction = NULL; | ||
44 | |||
43 | handle->internal_head = NULL; | 45 | handle->internal_head = NULL; |
44 | handle->internal_tail = NULL; | 46 | handle->internal_tail = NULL; |
45 | 47 | ||
@@ -85,7 +87,6 @@ handle_create_from_config (const struct GNUNET_CONFIGURATION_Handle* cfg, | |||
85 | handle->accounts_tail = NULL; | 87 | handle->accounts_tail = NULL; |
86 | 88 | ||
87 | handle->current = NULL; | 89 | handle->current = NULL; |
88 | handle->creation_op = NULL; | ||
89 | handle->monitor = NULL; | 90 | handle->monitor = NULL; |
90 | 91 | ||
91 | handle->lobbies_head = NULL; | 92 | handle->lobbies_head = NULL; |
@@ -154,25 +155,36 @@ handle_destroy (struct GNUNET_CHAT_Handle *handle) | |||
154 | if (handle->shutdown_hook) | 155 | if (handle->shutdown_hook) |
155 | GNUNET_SCHEDULER_cancel(handle->shutdown_hook); | 156 | GNUNET_SCHEDULER_cancel(handle->shutdown_hook); |
156 | 157 | ||
158 | if (handle->destruction) | ||
159 | GNUNET_SCHEDULER_cancel(handle->destruction); | ||
160 | |||
157 | if (handle->monitor) | 161 | if (handle->monitor) |
158 | GNUNET_NAMESTORE_zone_monitor_stop(handle->monitor); | 162 | GNUNET_NAMESTORE_zone_monitor_stop(handle->monitor); |
159 | 163 | ||
160 | if (handle->creation_op) | ||
161 | GNUNET_IDENTITY_cancel(handle->creation_op); | ||
162 | |||
163 | if (handle->current) | 164 | if (handle->current) |
164 | handle_disconnect(handle); | 165 | handle_disconnect(handle); |
165 | 166 | ||
166 | if (handle->namestore) | 167 | if (handle->namestore) |
167 | GNUNET_NAMESTORE_disconnect(handle->namestore); | 168 | GNUNET_NAMESTORE_disconnect(handle->namestore); |
168 | 169 | ||
170 | struct GNUNET_CHAT_InternalAccounts *accounts; | ||
171 | accounts = handle->accounts_head; | ||
172 | |||
173 | while (accounts) | ||
174 | { | ||
175 | if (accounts->op) | ||
176 | GNUNET_IDENTITY_cancel(accounts->op); | ||
177 | |||
178 | accounts->op = NULL; | ||
179 | accounts = accounts->next; | ||
180 | } | ||
181 | |||
169 | if (handle->identity) | 182 | if (handle->identity) |
170 | GNUNET_IDENTITY_disconnect(handle->identity); | 183 | GNUNET_IDENTITY_disconnect(handle->identity); |
171 | 184 | ||
172 | if (handle->arm) | 185 | if (handle->arm) |
173 | GNUNET_ARM_disconnect(handle->arm); | 186 | GNUNET_ARM_disconnect(handle->arm); |
174 | 187 | ||
175 | struct GNUNET_CHAT_InternalAccounts *accounts; | ||
176 | while (handle->accounts_head) | 188 | while (handle->accounts_head) |
177 | { | 189 | { |
178 | accounts = handle->accounts_head; | 190 | accounts = handle->accounts_head; |