From 7595b4f1c7d074e9f6c4dc28e58fcaa627fa02a9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 29 Mar 2018 16:53:12 +0200 Subject: [PATCH] settings: don't let connection keep NMSettings alive NMSettings already references NMSettingsConnection. Hence, it should not at the same time reference itself. Arguably, during shutdown we do not properly release all NMSettingsConnection. For example, there is no nm_settings_stop(). But that is a bug that needs fixing. No need to keep the NMSettings instance alive here. If this is really necessary, it needs fixing somewhere else. Besides, we know that we leak a lot during shutdown, so this needs more work to do a clean shutdown. --- src/settings/nm-settings.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index e3a9fd4c19..ae3f4e933c 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -878,7 +878,6 @@ connection_removed (NMSettingsConnection *connection, gpointer user_data) g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (connection_flags_changed), self); if (!priv->startup_complete) g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (connection_ready_changed), self); - g_object_unref (self); _clear_connections_cached_list (&priv->connections_cached_list); @@ -1000,7 +999,6 @@ claim_connection (NMSettings *self, NMSettingsConnection *connection) /* Evil openconnect migration hack */ openconnect_migrate_hack (NM_CONNECTION (connection)); - g_object_ref (self); /* This one unexports the connection, it needs to run late to give the active * connection a chance to deal with its reference to this settings connection. */ g_signal_connect_after (connection, NM_SETTINGS_CONNECTION_REMOVED,