[gnome-calendar/mcatanzaro/timeline-source-leak] timeline: fix leak of timeline source
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-calendar/mcatanzaro/timeline-source-leak] timeline: fix leak of timeline source
- Date: Tue, 14 Apr 2020 22:03:44 +0000 (UTC)
commit 165a9de9a471d020691c2c51c24eca1a498e13d7
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Tue Apr 14 17:02:12 2020 -0500
    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..10587993 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 (timeline_source);
+  g_clear_pointer (&self->timeline_source, g_source_unref);
 
   if (self->event_queue)
     {
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]