aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk_main-window-search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-fs-gtk_main-window-search.c')
-rw-r--r--src/fs/gnunet-fs-gtk_main-window-search.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/fs/gnunet-fs-gtk_main-window-search.c b/src/fs/gnunet-fs-gtk_main-window-search.c
index 58159c3b..45aaf590 100644
--- a/src/fs/gnunet-fs-gtk_main-window-search.c
+++ b/src/fs/gnunet-fs-gtk_main-window-search.c
@@ -298,14 +298,16 @@ main_window_search_entry_key_press_event_cb (GtkWidget * widget,
298 298
299 299
300/** 300/**
301 * Abort the given PSEU lookup. 301 * Asynchronously clean up PseuLookupContext.
302 * 302 *
303 * @param lctx lookup to abort. 303 * @param cls the `struct PseuLookupContext` to clean up.
304 * @param tc scheduler context
304 */ 305 */
305void 306static void
306abort_pseu_lookup (struct PseuLookupContext *lctx) 307end_pseu_lookup (void *cls,
308 const struct GNUNET_SCHEDULER_TaskContext *tc)
307{ 309{
308 struct GNUNET_GTK_MainWindowContext *main_ctx = lctx->main_ctx; 310 struct PseuLookupContext *lctx = cls;
309 311
310 if (NULL != lctx->progress_dialog_builder) 312 if (NULL != lctx->progress_dialog_builder)
311 { 313 {
@@ -335,11 +337,26 @@ abort_pseu_lookup (struct PseuLookupContext *lctx)
335 GNUNET_NAMESTORE_disconnect (lctx->namestore); 337 GNUNET_NAMESTORE_disconnect (lctx->namestore);
336 lctx->namestore = NULL; 338 lctx->namestore = NULL;
337 } 339 }
340 GNUNET_free_non_null (lctx->nick);
341 GNUNET_free (lctx);
342}
343
344
345/**
346 * Abort the given PSEU lookup.
347 *
348 * @param lctx lookup to abort.
349 */
350void
351abort_pseu_lookup (struct PseuLookupContext *lctx)
352{
353 struct GNUNET_GTK_MainWindowContext *main_ctx = lctx->main_ctx;
354
338 GNUNET_CONTAINER_DLL_remove (main_ctx->lctx_head, 355 GNUNET_CONTAINER_DLL_remove (main_ctx->lctx_head,
339 main_ctx->lctx_tail, 356 main_ctx->lctx_tail,
340 lctx); 357 lctx);
341 GNUNET_free_non_null (lctx->nick); 358 (void) GNUNET_SCHEDULER_add_now (&end_pseu_lookup,
342 GNUNET_free (lctx); 359 lctx);
343} 360}
344 361
345 362