From 098de49acf20f12a925cea8bf4b0d2bc90c9b44d Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Tue, 3 Apr 2012 12:15:00 -0400 Subject: [PATCH] attrib: Fix D-Bus service disconnect watch removal watcher_free() will be automatically called when removing the D-Bus watch (it was set as the destroy callback when adding the watch), therefore it is only necessary to remove the watch. --- attrib/client.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/attrib/client.c b/attrib/client.c index f1c26c468..b5282c271 100644 --- a/attrib/client.c +++ b/attrib/client.c @@ -227,6 +227,7 @@ static void watcher_exit(DBusConnection *conn, void *user_data) DBG("%s watcher %s exited", gatt->path, watcher->name); gatt->watchers = g_slist_remove(gatt->watchers, watcher); + g_dbus_remove_watch(gatt->conn, watcher->id); remove_attio(gatt); } @@ -429,10 +430,8 @@ static DBusMessage *unregister_watcher(DBusConnection *conn, return btd_error_not_authorized(msg); watcher = l->data; - g_dbus_remove_watch(conn, watcher->id); gatt->watchers = g_slist_remove(gatt->watchers, watcher); - watcher_free(watcher); - + g_dbus_remove_watch(conn, watcher->id); remove_attio(gatt); return dbus_message_new_method_return(msg); -- 2.47.3