diff options
author | Havoc Pennington <hp@redhat.com> | 2003-01-18 17:40:42 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-01-18 17:40:42 +0000 |
commit | 0363701c341796278041fb9ea7de80eaaf41479a (patch) | |
tree | 005dc8da9378917aad6cf57636b2c2558ec108bb /bus/connection.c | |
parent | 6ac750b03fb32591769d0a6ece8840932622fead (diff) |
2003-01-18 Havoc Pennington <hp@pobox.com>
* dbus/dbus-connection.c (dbus_connection_unref): disconnect the
connection if it hasn't been already.
* dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
replace with DisconnectFunction.
Diffstat (limited to 'bus/connection.c')
-rw-r--r-- | bus/connection.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/bus/connection.c b/bus/connection.c index f4c19dd2..a80e46d4 100644 --- a/bus/connection.c +++ b/bus/connection.c @@ -37,21 +37,16 @@ typedef struct #define BUS_CONNECTION_DATA(connection) (dbus_connection_get_data ((connection), connection_data_slot)) static void -connection_error_handler (DBusConnection *connection, - DBusResultCode error_code, - void *data) +connection_disconnect_handler (DBusConnection *connection, + void *data) { BusConnectionData *d; BusService *service; - _dbus_warn ("Error on connection: %s\n", - dbus_result_to_string (error_code)); + _dbus_warn ("Disconnected\n"); d = BUS_CONNECTION_DATA (connection); - _dbus_assert (d != NULL); - - /* we don't want to be called again since we're dropping the connection */ - dbus_connection_set_error_function (connection, NULL, NULL, NULL); + _dbus_assert (d != NULL); /* Drop any service ownership */ while ((service = _dbus_list_get_last (&d->services_owned))) @@ -151,9 +146,9 @@ bus_connection_setup (DBusConnection *connection) connection, NULL); - dbus_connection_set_error_function (connection, - connection_error_handler, - NULL, NULL); + dbus_connection_set_disconnect_function (connection, + connection_disconnect_handler, + NULL, NULL); return TRUE; } |