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
This commit is contained in:
Lubomir Rintel 2014-10-31 15:44:31 +01:00
parent 1f275a980a
commit 4f9e2e9603

View file

@ -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);