From 4334f2d3cf80f68625ebf8c2e4807ce858d7b606 Mon Sep 17 00:00:00 2001 From: Jinkun Hong Date: Fri, 10 Apr 2020 15:23:03 +0800 Subject: [PATCH] dbus: Solve the problem of probabilistic no callback Signed-off-by: Jinkun Hong --- dbus/dbus-pending-call.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-pending-call.c b/dbus/dbus-pending-call.c index be53410..e3c18ac 100644 --- a/dbus/dbus-pending-call.c +++ b/dbus/dbus-pending-call.c @@ -629,13 +629,14 @@ dbus_pending_call_set_notify (DBusPendingCall *pending, _dbus_return_val_if_fail (pending != NULL, FALSE); CONNECTION_LOCK (pending->connection); - + + pending->function = function; + /* could invoke application code! */ if (!_dbus_pending_call_set_data_unlocked (pending, notify_user_data_slot, user_data, free_user_data)) goto out; - pending->function = function; ret = TRUE; out: -- 2.7.4