diff options
author | Dan Winship <danw@redhat.com> | 2015-01-05 15:35:57 -0500 |
---|---|---|
committer | Dan Winship <danw@redhat.com> | 2015-01-05 15:35:57 -0500 |
commit | b4542677619758c300a7149ed964ffc011c84fad (patch) | |
tree | 216177a1bdc4f50c4c5bf326385c429734d8fd44 | |
parent | 0de60b300ed6cc0fc94c742396112b1274989371 (diff) | |
download | NetworkManager-b4542677619758c300a7149ed964ffc011c84fad.tar.gz |
libnm-glib: crash when NMRemoteSettings is quickly destroyed (bgo #742138)
NMRemoteSettings queues a bunch of async NMRemoteConnection creations,
but wasn't doing anything to ensure that it was still alive when they
completed. Pointed out by Cosimo Cecchi.
https://bugzilla.gnome.org/show_bug.cgi?id=742138
-rw-r--r-- | libnm-glib/nm-remote-settings.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c index 74ed083f9b..d5f4ca67f0 100644 --- a/libnm-glib/nm-remote-settings.c +++ b/libnm-glib/nm-remote-settings.c @@ -511,6 +511,8 @@ connection_inited (GObject *source, GAsyncResult *result, gpointer user_data) priv->init_left--; if (priv->init_left == 0) g_signal_emit (self, signals[CONNECTIONS_READ], 0); + + g_object_unref (self); } static NMRemoteConnection * @@ -533,7 +535,7 @@ new_connection_cb (DBusGProxy *proxy, const char *path, gpointer user_data) if (connection) { g_async_initable_init_async (G_ASYNC_INITABLE (connection), G_PRIORITY_DEFAULT, NULL, - connection_inited, self); + connection_inited, g_object_ref (self)); /* Add the connection to the pending table to wait for it to retrieve * it's settings asynchronously over D-Bus. The connection isn't |