[gnome-calendar/gnome-3-36] timeline: fix leak of timeline source
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/gnome-3-36] timeline: fix leak of timeline source
- Date: Thu, 16 Apr 2020 19:57:07 +0000 (UTC)
commit 3d42fc8eef0e82504058f2a0fcf3399cdfd74858
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..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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]