Commit 8bb871ec authored by Christian Hergert's avatar Christian Hergert

egg-task-cache: handle cancelled tasks when freeing cancelled state

If we reached this via the cancellation of the task (and then free'ing of
the GTask), then we shouldn't try to disconnect or we'll dead-lock.

https://bugzilla.gnome.org/show_bug.cgi?id=779660
parent e6b93cf2
......@@ -235,9 +235,13 @@ cancelled_data_free (gpointer data)
g_clear_pointer (&cancelled->key, cancelled->self->key_destroy_func);
g_cancellable_disconnect (cancelled->cancellable, cancelled->cancelled_id);
g_clear_object (&cancelled->cancellable);
cancelled->cancelled_id = 0;
if (cancelled->cancelled_id != 0)
{
g_cancellable_disconnect (cancelled->cancellable, cancelled->cancelled_id);
cancelled->cancelled_id = 0;
g_clear_object (&cancelled->cancellable);
}
cancelled->self = NULL;
......@@ -477,6 +481,8 @@ egg_task_cache_cancelled_cb (GCancellable *cancellable,
self = (EggTaskCache *)g_task_get_source_object (task);
data = (CancelledData *)g_task_get_task_data (task);
data->cancelled_id = 0;
if ((queued = g_hash_table_lookup (self->queued, data->key)))
{
gsize i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment