summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-08-20 15:32:20 +0200
committerThomas Haller <thaller@redhat.com>2015-08-20 15:38:47 +0200
commitf9ab503a2f497657857b94d610e0d9aec4d6d2e5 (patch)
tree2f46314bdeae1519455d89d5898d10f970f35bf7
parente8dd82cae21d5ec21f6e6002482c039a45f37d73 (diff)
downloadNetworkManager-th/prop-filter-bgo753874.tar.gz
fixup! manager: fix race subscribing prop_filter()th/prop-filter-bgo753874
-rw-r--r--src/nm-manager.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 8665a4be91..9a2a3e7740 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -4588,11 +4588,24 @@ prop_filter (GDBusConnection *connection,
/******************************************************************************/
+static int
+_set_prop_filter_free2 (gpointer user_data)
+{
+ g_slice_free (GWeakRef, user_data);
+ return G_SOURCE_REMOVE;
+}
+
static void
_set_prop_filter_free (gpointer user_data)
{
g_weak_ref_clear (user_data);
- g_slice_free (GWeakRef, user_data);
+
+ /* Delay the final deletion of the user_data. There is a race when
+ * calling g_dbus_connection_remove_filter() that the callback and user_data
+ * might have been copied and being executed after the destroy function
+ * runs.
+ * This doesn't really fix the race, but it should work well enough. */
+ g_idle_add (_set_prop_filter_free2, user_data);
}
static void