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:
@@ -589,6 +589,13 @@ timeline_source_dispatch (GSource *source,
|
|||||||
subscriber = queue_data->subscriber;
|
subscriber = queue_data->subscriber;
|
||||||
event_range = gcal_event_get_range (event);
|
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)
|
switch (queue_data->queue_event)
|
||||||
{
|
{
|
||||||
case ADD_EVENT:
|
case ADD_EVENT:
|
||||||
|
|||||||
Reference in New Issue
Block a user