diff options
author | Thomas Haller <thaller@redhat.com> | 2018-04-13 10:31:07 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-04-13 10:34:43 +0200 |
commit | e41db3fa558c6c58805fde5222a01773e0eb18f2 (patch) | |
tree | 8d52f28d9fb407b0f6940793156232fce7f1f9d4 | |
parent | a92543d3b7c012bac98a3822dd6028cae64e67de (diff) | |
download | NetworkManager-e41db3fa558c6c58805fde5222a01773e0eb18f2.tar.gz |
settings: fix clearing agent-manager in NMSettings' dispose()
dispose() should be re-entrant. When releasing a resource, it must not
leave a dangling pointer. While at it, just move it to finalize() instead.
-rw-r--r-- | src/settings/nm-settings.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index c92373f020..3cb0f4fab5 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -1915,8 +1915,6 @@ dispose (GObject *object) g_slist_free_full (priv->auths, (GDestroyNotify) nm_auth_chain_destroy); priv->auths = NULL; - g_object_unref (priv->agent_mgr); - if (priv->hostname_manager) { g_signal_handlers_disconnect_by_func (priv->hostname_manager, G_CALLBACK (_hostname_changed_cb), @@ -1942,6 +1940,8 @@ finalize (GObject *object) g_slist_free_full (priv->plugins, g_object_unref); + g_clear_object (&priv->agent_mgr); + g_clear_object (&priv->config); G_OBJECT_CLASS (nm_settings_parent_class)->finalize (object); |