From 7de9bc618a00b3749ae9ddbf9c206a112686b3c7 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 17 Feb 2015 12:28:55 +0100 Subject: [PATCH] default-route-manager/trivial: add code comment --- src/nm-default-route-manager.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nm-default-route-manager.c b/src/nm-default-route-manager.c index ae80abbc6..27b5d783a 100644 --- a/src/nm-default-route-manager.c +++ b/src/nm-default-route-manager.c @@ -1380,6 +1380,13 @@ dispose (GObject *object) _resync_idle_cancel (self); + /* g_ptr_array_free() invokes the free function for all entries without actually + * removing them and having dangling pointers in the process. _entry_free() + * will unref the source, which might cause the destruction of the object, which + * might trigger calling into @self again. This is guarded by priv->dispose. + * If you remove priv->dispose, you must refactor the lines below to remove enties + * one-by-one. + */ if (priv->entries_ip4) { g_ptr_array_free (priv->entries_ip4, TRUE); priv->entries_ip4 = NULL;