[python] destroying objects

Robert McQueen robert.mcqueen at collabora.co.uk
Wed Sep 21 04:40:49 PDT 2005

There seems to be no support for removing objects from the bus in the
python bindings at the moment. I had a look at hacking it in, but
comments where unregister_object_path would be suggest it can't be done
until remove_filter is implemented, which is tricky because (I think)
there could be pending callbacks to the message_function_handler in the
glib loop.

Two things... firstly it doesn't look to me like remove_filter is needed
to implement unregister_object_path because add_filter is only ever used
on a per-bus connection basis. Removing an object from the bus should
just be a case of removing its signal callbacks from the match tree,
then calling dbus_connection_unregister_object_path.

Secondly, if remove_filter does turn out to be necessary somehow, could
you not just extend the dbus_glib_bindings to allow setting up idle
callbacks, and hence set up a one-off idle callback to remove the filter
after all of the pending calls have been processed?

Or am I missing something? :)


More information about the dbus mailing list