mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-23 19:24:38 +00:00
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:
parent
6a75c9b8e8
commit
1981323b19
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue