From 0363701c341796278041fb9ea7de80eaaf41479a Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 18 Jan 2003 17:40:42 +0000 Subject: 2003-01-18 Havoc Pennington * 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. --- test/watch.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/watch.c b/test/watch.c index f9b8b8d9..02a1e976 100644 --- a/test/watch.c +++ b/test/watch.c @@ -297,16 +297,10 @@ quit_mainloop (void) } static void -error_handler (DBusConnection *connection, - DBusResultCode error_code, - void *data) +disconnect_handler (DBusConnection *connection, + void *data) { - fprintf (stderr, - "Error on connection: %s\n", - dbus_result_to_string (error_code)); - - /* we don't want to be called again since we're dropping the connection */ - dbus_connection_set_error_function (connection, NULL, NULL, NULL); + fprintf (stderr, "Disconnected\n"); _dbus_list_remove (&connections, connection); dbus_connection_unref (connection); @@ -322,9 +316,9 @@ setup_connection (DBusConnection *connection) connection, NULL); - dbus_connection_set_error_function (connection, - error_handler, - NULL, NULL); + dbus_connection_set_disconnect_function (connection, + disconnect_handler, + NULL, NULL); dbus_connection_ref (connection); _dbus_list_append (&connections, connection); -- cgit