From b4847cb5fbf2f818dbca6844d097fbc3eff44923 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 15 Dec 2012 16:49:02 +0100 Subject: [PATCH] client: Print warning if leaking a proxy object --- client/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/main.c b/client/main.c index e30946fa7..95d237f59 100644 --- a/client/main.c +++ b/client/main.c @@ -50,6 +50,11 @@ static GDBusProxy *default_ctrl; static GList *ctrl_list; static GList *dev_list; +static void proxy_leak(gpointer data) +{ + printf("Leaking proxy %p\n", data); +} + static void connect_handler(DBusConnection *connection, void *user_data) { rl_set_prompt(COLOR_BLUE "[bluetooth]" COLOR_OFF "# "); @@ -967,5 +972,8 @@ int main(int argc, char *argv[]) dbus_connection_unref(dbus_conn); g_main_loop_unref(main_loop); + g_list_free_full(ctrl_list, proxy_leak); + g_list_free_full(dev_list, proxy_leak); + return 0; } -- 2.47.3