changeset 18133:31685102ee94

Uninit dbus properly.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 16 Jun 2007 23:11:41 +0000
parents 17f7d072d471
children 9b2cd6920475
files libpurple/dbus-server.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/dbus-server.c	Sat Jun 16 22:35:25 2007 +0000
+++ b/libpurple/dbus-server.c	Sat Jun 16 23:11:41 2007 +0000
@@ -797,8 +797,18 @@
 void
 purple_dbus_uninit(void)
 {
-	/* Surely we must do SOME kind of uninitialization? */
+	DBusError error;
+	if (!purple_dbus_connection)
+		return;
 
+	dbus_error_init(&error);
+	dbus_connection_unregister_object_path(purple_dbus_connection, DBUS_PATH_PURPLE);
+	dbus_bus_release_name(purple_dbus_connection, DBUS_SERVICE_PURPLE, &error);
+	dbus_error_free(&error);
+	dbus_connection_unref(purple_dbus_connection);
+	purple_dbus_connection = NULL;
+	purple_signals_disconnect_by_handle(purple_dbus_get_handle());
 	g_free(init_error);
 	init_error = NULL;
 }
+