# HG changeset patch # User Yoshiki Yazawa # Date 1223659957 -32400 # Node ID 62265a3a1870b504fc611bed55ca2518f9e69bf5 # Parent 885c21b8684e489e17b60d435b218eb8a19fbd8d added audtool_disconnect(). diff -r 885c21b8684e -r 62265a3a1870 src/audtool/main.c --- a/src/audtool/main.c Sat Oct 04 23:48:49 2008 +0100 +++ b/src/audtool/main.c Sat Oct 11 02:32:37 2008 +0900 @@ -139,7 +139,7 @@ {"list-handlers", get_handlers_list, "shows handlers list", 0}, {"help", get_handlers_list, "shows handlers list", 0}, - + {NULL, NULL, NULL, 0} }; @@ -147,7 +147,8 @@ DBusGProxy *dbus_proxy = NULL; static DBusGConnection *connection = NULL; -static void audtool_connect(void) +static void +audtool_connect(void) { GError *error = NULL; @@ -164,7 +165,15 @@ AUDACIOUS_DBUS_INTERFACE); } -gint main(gint argc, gchar **argv) +static void +audtool_disconnect(void) +{ + g_object_unref(dbus_proxy); + dbus_proxy = NULL; +} + +gint +main(gint argc, gchar **argv) { gint i, j = 0, k = 0; @@ -203,5 +212,7 @@ if (k == 0) mowgli_error_context_display_with_error(e, ":\n * ", g_strdup_printf("Unknown command '%s' encountered, use \'audtool help\' for a command list.", argv[1])); + audtool_disconnect(); + return 0; }