summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-12-15 16:21:58 +0100
committerMarcel Holtmann <marcel@holtmann.org>2012-12-15 16:21:58 +0100
commit96789cce0b3f70e03d5dddb04fc585dfc2a04cf6 (patch)
tree70245a18c6de9a4fb689978ac2855f1aa300952c
parentb0e63efb1c4b85edced069628e8010c93611642c (diff)
client: Reset default controller and device list on disconnect
-rw-r--r--client/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/client/main.c b/client/main.c
index ddfe51148..e30946fa7 100644
--- a/client/main.c
+++ b/client/main.c
@@ -56,8 +56,6 @@ static void connect_handler(DBusConnection *connection, void *user_data)
printf("\r");
rl_on_new_line();
rl_redisplay();
-
- default_ctrl = NULL;
}
static void disconnect_handler(DBusConnection *connection, void *user_data)
@@ -69,6 +67,11 @@ static void disconnect_handler(DBusConnection *connection, void *user_data)
g_list_free(ctrl_list);
ctrl_list = NULL;
+
+ default_ctrl = NULL;
+
+ g_list_free(dev_list);
+ dev_list = NULL;
}
static void print_adapter(GDBusProxy *proxy, const char *description)