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

Thiago Macieira thiago at kde.org
Wed Jul 20 06:26:52 UTC 2016


On quarta-feira, 20 de julho de 2016 05:13:59 PDT Norris, David wrote:
> 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:

For every ref() that you call, you call one unref(). No more, no fewer.

> 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!

Correct.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center



More information about the dbus mailing list