summaryrefslogtreecommitdiff
path: root/libnm/nm-object.c
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2018-03-05 16:02:24 +0100
committerThomas Haller <thaller@redhat.com>2018-03-08 14:52:45 +0100
commit26c215e22dcfff9e61a58e9348991ed77c3f8861 (patch)
treeab7cbe276d8fc3dcc12ed677294fa0c85396f94f /libnm/nm-object.c
parentd76cfa3814915cc12c7af9e7bdc4d7ac3dc71e49 (diff)
downloadNetworkManager-26c215e22dcfff9e61a58e9348991ed77c3f8861.tar.gz
Add calls to g_simple_async_result_set_check_cancellable
If an operation is cancelled through the GCancellable, then the idiom is that the operation is always cancelled, even if it has finished successfully. To ensure this is the case, add calls to g_simple_async_result_set_check_cancellable everywhere. Without this, e.g. gnome-control-center will crash when switching away from the power panel quickly, as the NMClient creation finishes asynchronously and g-c-c assume that G_IO_ERROR_CANCELLED is returned to ensure it doesn't access the now invalid user_data parameter. https://bugzilla.gnome.org/show_bug.cgi?id=794088
Diffstat (limited to 'libnm/nm-object.c')
-rw-r--r--libnm/nm-object.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libnm/nm-object.c b/libnm/nm-object.c
index 4fa9b7bd33..fc7a82af98 100644
--- a/libnm/nm-object.c
+++ b/libnm/nm-object.c
@@ -1132,6 +1132,8 @@ init_async (GAsyncInitable *initable, int io_priority,
init_data = g_slice_new0 (NMObjectInitData);
init_data->object = self;
init_data->simple = g_simple_async_result_new (G_OBJECT (initable), callback, user_data, init_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (init_data->simple, cancellable);
init_data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
interfaces = g_dbus_object_get_interfaces (priv->object);