mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 16:40:13 +01:00
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
This commit is contained in:
parent
f6cd8f06f4
commit
3d47cf5823
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue