aboutsummaryrefslogtreecommitdiff
path: root/src/anastasis/anastasis-gtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/anastasis/anastasis-gtk.c')
-rw-r--r--src/anastasis/anastasis-gtk.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/anastasis/anastasis-gtk.c b/src/anastasis/anastasis-gtk.c
index 4023b16..3a1e5e5 100644
--- a/src/anastasis/anastasis-gtk.c
+++ b/src/anastasis/anastasis-gtk.c
@@ -61,6 +61,17 @@ static struct GNUNET_CURL_Context *ctx;
struct ANASTASIS_ReduxAction *AG_ra;
/**
+ * Handle to an ongoing background action.
+ */
+struct ANASTASIS_ReduxAction *AG_long_action;
+
+/**
+ * Handle to task to reschedule #AG_long_action.
+ */
+struct GNUNET_SCHEDULER_Task *AG_long_task;
+
+
+/**
* Actual state.
*/
json_t *AG_redux_state;
@@ -143,6 +154,22 @@ anastasis_gtk_animation_activate_cb (GtkMenuItem *menuitem,
}
+void
+AG_stop_long_action (void)
+{
+ if (NULL != AG_long_action)
+ {
+ ANASTASIS_redux_action_cancel (AG_long_action);
+ AG_long_action = NULL;
+ }
+ if (NULL != AG_long_task)
+ {
+ GNUNET_SCHEDULER_cancel (AG_long_task);
+ AG_long_task = NULL;
+ }
+}
+
+
/**
* Task run on shutdown.
*
@@ -160,6 +187,7 @@ shutdown_task (void *cls)
ANASTASIS_redux_action_cancel (AG_ra);
AG_ra = NULL;
}
+ AG_stop_long_action ();
if (NULL != ctx)
{
GNUNET_CURL_fini (ctx);