diff options
author | Dan Winship <danw@gnome.org> | 2013-11-14 13:00:22 -0500 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2013-11-14 13:01:55 -0500 |
commit | 1981323b19f1ad22e53ef9ac1cd3783346e7c121 (patch) | |
tree | 28a07b77db9620027454774fa77518391c92b3fa | |
parent | 6a75c9b8e8c92562bd16ac63718167926cd09317 (diff) | |
download | NetworkManager-1981323b19f1ad22e53ef9ac1cd3783346e7c121.tar.gz |
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.
-rw-r--r-- | libnm-glib/nm-object.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c index e58b020501..127f2af6a6 100644 --- a/libnm-glib/nm-object.c +++ b/libnm-glib/nm-object.c @@ -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; } |