From e9812b2f28df542e40a98315446ece40d6ece807 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 15 Apr 2020 18:47:19 -0300 Subject: [PATCH] timeline: Don't try to use removed subscribers Because the timeline is essentially asynchronous, it may try and process events after their subscribers were removed. Protect against that. Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/576 --- src/core/gcal-timeline.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/gcal-timeline.c b/src/core/gcal-timeline.c index f4db58f1..b5d683fb 100644 --- a/src/core/gcal-timeline.c +++ b/src/core/gcal-timeline.c @@ -589,6 +589,13 @@ timeline_source_dispatch (GSource *source, subscriber = queue_data->subscriber; event_range = gcal_event_get_range (event); + /* The subscriber may have been removed already */ + if (!g_hash_table_contains (self->subscribers, subscriber)) + { + queue_data_free (queue_data); + continue; + } + switch (queue_data->queue_event) { case ADD_EVENT: