From 4f9e2e960372fa116931bcc06563a9c3c638dbd7 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 31 Oct 2014 15:44:31 +0100 Subject: [PATCH] libnm: Fix a nm_running_changed race Unhook the nm_running_changed signal, so that it does not attempt to free connections after they've been disposed already. https://bugzilla.gnome.org/show_bug.cgi?id=739127 --- libnm/nm-remote-settings.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libnm/nm-remote-settings.c b/libnm/nm-remote-settings.c index 351fbc1bd2..a37cbe9f8b 100644 --- a/libnm/nm-remote-settings.c +++ b/libnm/nm-remote-settings.c @@ -681,7 +681,7 @@ init_dbus (NMObject *object) property_info); g_signal_connect (object, "notify::" NM_OBJECT_NM_RUNNING, - G_CALLBACK (nm_running_changed), NULL); + G_CALLBACK (nm_running_changed), object); } static GObject * @@ -727,6 +727,8 @@ dispose (GObject *object) g_clear_pointer (&priv->all_connections, g_ptr_array_unref); } + g_signal_handlers_disconnect_by_func (object, G_CALLBACK (nm_running_changed), self); + g_clear_pointer (&priv->visible_connections, g_ptr_array_unref); g_clear_pointer (&priv->hostname, g_free);