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
This commit is contained in:
Georges Basile Stavracas Neto
2020-04-15 18:49:36 -03:00
parent db668a0b90
commit e9812b2f28
+7
View File
@@ -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: