Is It Valid To Call dbus_pending_call_steal_reply before reply is available?

Lawrence D'Oliveiro <ldo-kC51rjc0cqs1dNLGKZg6taU/[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Organization Geek Central
Message-ID <[email protected]>
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.
_______________________________________________
dbus mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dbus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.