Filter called more than once...

Havoc Pennington hp at redhat.com
Tue Mar 6 19:51:41 PST 2007



Havoc Pennington wrote:
>> 1.  It should not call the same recv function again if  it already  
>> returned NOT_YET _HANDLED. Correct?
> 
> Yes. The only exception I can think of is that if there's an 
> out-of-memory error during dispatch, it's possible the dispatch restarts 
> with the first handler. I'm not sure how this works offhand.

To be clear, in the not-out-of-memory case it sounds like a bug if a 
handler is called twice, but you'll need to track it down at least to 
the point of providing a small compilable test case before anyone else 
is likely to make progress on it...

Also,

> Only dbus_shutdown() which shuts down the entire library (you must 
> free/unref any memory from libdbus that you own, prior to dbus_shutdown())

dbus_shutdown() is entirely optional and really intended only for people 
who like to use valgrind or equivalent in the "is everything freed on 
exit" mode (vs. the "is everything reachable from the gc roots" mode). 
It's really a debugging-only thing. There is no reason to use 
dbus_shutdown() unless you enjoy pain. Also, dbus_shutdown() should 
never be used from a library, since the library can't know whether 
anyone is still using libdbus. When used, it should be at the end of 
main() after the rest of the app is shut down already.

Havoc




More information about the dbus mailing list