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.
This commit is contained in:
Thomas Haller 2018-03-29 16:53:12 +02:00
parent 1f3b47deea
commit 7595b4f1c7

View file

@ -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,