edbus: Increment/decrement edbus refcount when processing signals

This allows the user to shutdown edbus inside a signal callback.

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 82071
This commit is contained in:
José Roberto de Souza 2013-01-03 14:05:45 +00:00 committed by Lucas De Marchi
parent 8c67bafaf2
commit 9e1f5d80fe
1 changed files with 2 additions and 0 deletions

View File

@ -780,6 +780,7 @@ cb_signal_dispatcher(EDBus_Connection *conn, DBusMessage *msg)
&edbus_msg->iterator->dbus_iterator);
edbus_connection_ref(conn);
edbus_init();
/*
* Do the walking open-coded so we don't crash if a callback
* removes other signal handlers from the list and we don't own
@ -841,6 +842,7 @@ cb_signal_dispatcher(EDBus_Connection *conn, DBusMessage *msg)
edbus_message_unref(edbus_msg);
edbus_connection_unref(conn);
edbus_shutdown();
}
static DBusHandlerResult