From 60c3c26ad651826ccdba5782168fe4ac3d584d42 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Tue, 14 Apr 2020 17:02:12 -0500 Subject: [PATCH] timeline: fix leak of timeline source g_source_destroy doesn't free memory, just removes the source from its main context. We have to do both. (g_source_unref() might call g_source_destroy() if it has the last ref, but if something else has another ref, then disaster could result if we don't call it manually.) --- src/core/gcal-timeline.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/gcal-timeline.c b/src/core/gcal-timeline.c index ec85cdfb..9040585d 100644 --- a/src/core/gcal-timeline.c +++ b/src/core/gcal-timeline.c @@ -681,7 +681,9 @@ gcal_timeline_finalize (GObject *object) g_clear_pointer (&self->calendars, g_hash_table_destroy); g_clear_pointer (&self->subscribers, g_hash_table_destroy); g_clear_pointer (&self->subscriber_ranges, gcal_range_tree_unref); - g_clear_pointer (&self->timeline_source, g_source_destroy); + + g_source_destroy (self->timeline_source); + g_clear_pointer (&self->timeline_source, g_source_unref); if (self->event_queue) {