libdbus-1: unref a filter handler's message arg?

Norris, David norris at hbm.com
Wed Jul 20 05:13:59 UTC 2016


Hi,

When using libdbus-1, should dbus_message_unref() be called inside the DBusHandleMessageFunction passed to dbus_connection_add_filter()? I've been doing so, but recently started noticing assertion failures:

    process <pid>: arguments to dbus_message_unref() were incorrect, assertion "!message->in_cache" failed in file ../../dbus/dbus-message.c line 1619.

This leads me to think I shouldn't unref the message object inside the function, and that I should only unref messages I actually "own" (i.e., I created them). Is that correct, or do I need to look a little deeper for problems elsewhere in my binding? Thanks!

Cheers,

David Norris
Software Engineer, HBM Test and Measurement


More information about the dbus mailing list