Is It Valid To Call dbus_pending_call_steal_reply before reply is available?

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Sun Nov 4 02:27:22 UTC 2018


The documentation for dbus_pending_call_steal_reply()
<https://dbus.freedesktop.org/doc/api/html/group__DBusPendingCall.html#ga5a738928c2369fef093ce00658903d06>
says “Gets the reply, or returns NULL if none has been received yet.”
However, it looks like trying to steal the reply before one is
available is actually treated as a program bug, triggering a message
like

    dbus[3481]: arguments to dbus_pending_call_steal_reply() were
    incorrect, assertion "pending->completed" failed in
    file ../../../dbus/dbus-pending-call.c line 733.
    This is normally a bug in some application using the D-Bus library.

Furthermore, it looks like it is possible to get spurious calls to your
pending-call-notify function, so you need to check that the call has
actually completed before trying to retrieve the reply, ignoring the
notification otherwise.


More information about the dbus mailing list