libnm-glib: fix a crash in NMObject

deferred_notify_cb() needs to take a ref on the object around emitting
its deferred signals, since otherwise if a notify:: handler drops the
last reference on an object, a following g_object_notify() call would
crash.
This commit is contained in:
Dan Winship 2013-11-14 13:00:22 -05:00
parent 6a75c9b8e8
commit 1981323b19

View file

@ -524,10 +524,13 @@ deferred_notify_cb (gpointer data)
props = g_slist_reverse (priv->notify_props);
priv->notify_props = NULL;
g_object_ref (object);
for (iter = props; iter; iter = g_slist_next (iter)) {
g_object_notify (G_OBJECT (object), (const char *) iter->data);
g_free (iter->data);
}
g_object_unref (object);
g_slist_free (props);
return FALSE;
}