spa: bluez: add steal_reply_and_unref() helper

This function retrieves the reply from a DBusPendingCall and unrefs the call.
This commit is contained in:
Barnabás Pőcze 2023-07-11 17:10:37 +02:00
parent 183270f53c
commit 708e5443ae
7 changed files with 33 additions and 58 deletions

View file

@ -19,4 +19,14 @@ static inline void cancel_and_unref(DBusPendingCall **pp)
}
}
static inline DBusMessage *steal_reply_and_unref(DBusPendingCall **pp)
{
DBusPendingCall *pending_call = spa_steal_ptr(*pp);
DBusMessage *reply = dbus_pending_call_steal_reply(pending_call);
dbus_pending_call_unref(pending_call);
return reply;
}
#endif /* SPA_BLUEZ5_DBUS_HELPERS_H */