[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29277 - gnunet-gtk/src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29277 - gnunet-gtk/src/fs |
Date: |
Sun, 15 Sep 2013 21:35:07 +0200 |
Author: grothoff
Date: 2013-09-15 21:35:07 +0200 (Sun, 15 Sep 2013)
New Revision: 29277
Modified:
gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c
Log:
make PseuLookupContext cleanup asynchronous as GNUNET_NAMESTORE_disconnect
requires it
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c 2013-09-15
19:29:54 UTC (rev 29276)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-search.c 2013-09-15
19:35:07 UTC (rev 29277)
@@ -298,14 +298,16 @@
/**
- * Abort the given PSEU lookup.
+ * Asynchronously clean up PseuLookupContext.
*
- * @param lctx lookup to abort.
+ * @param cls the `struct PseuLookupContext` to clean up.
+ * @param tc scheduler context
*/
-void
-abort_pseu_lookup (struct PseuLookupContext *lctx)
+static void
+end_pseu_lookup (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- struct GNUNET_GTK_MainWindowContext *main_ctx = lctx->main_ctx;
+ struct PseuLookupContext *lctx = cls;
if (NULL != lctx->progress_dialog_builder)
{
@@ -335,11 +337,26 @@
GNUNET_NAMESTORE_disconnect (lctx->namestore);
lctx->namestore = NULL;
}
+ GNUNET_free_non_null (lctx->nick);
+ GNUNET_free (lctx);
+}
+
+
+/**
+ * Abort the given PSEU lookup.
+ *
+ * @param lctx lookup to abort.
+ */
+void
+abort_pseu_lookup (struct PseuLookupContext *lctx)
+{
+ struct GNUNET_GTK_MainWindowContext *main_ctx = lctx->main_ctx;
+
GNUNET_CONTAINER_DLL_remove (main_ctx->lctx_head,
main_ctx->lctx_tail,
lctx);
- GNUNET_free_non_null (lctx->nick);
- GNUNET_free (lctx);
+ (void) GNUNET_SCHEDULER_add_now (&end_pseu_lookup,
+ lctx);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29277 - gnunet-gtk/src/fs,
gnunet <=