Specifically, the problem appears to be that when an app calls dbus_connection_open(), one or more of the functions in nih_dbus_setup() should be being called to allow libdbus to interrupt the apps main loop and request callbacks are run to clean up resources.
This problem can now be demonstrated with a single connection to upstart that makes the following calls:
dbus_connection _open()
nih_dbus_proxy_new ()
The problem is not seen if the app instead calls:
- nih_dbus_connect (upstart_session, disconnect_handler)
- nih_dbus_proxy_new ()
- nih_main_loop()
Or,
- nih_dbus_connect (upstart_session, NULL)
- nih_dbus_proxy_new ()
- nih_main_loop()
Specifically, the problem appears to be that when an app calls dbus_connection _open() , one or more of the functions in nih_dbus_setup() should be being called to allow libdbus to interrupt the apps main loop and request callbacks are run to clean up resources.