aboutsummaryrefslogtreecommitdiffstats
path: root/attrib/client.c
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2012-04-03 12:15:00 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2012-04-04 13:00:14 +0300
commit098de49acf20f12a925cea8bf4b0d2bc90c9b44d (patch)
treefac007a01da3bc896438a880b9f60c429ff4a665 /attrib/client.c
parent371e9dfbe94343154146e7742abb80c30c3c2ad4 (diff)
downloadbluez-098de49acf20f12a925cea8bf4b0d2bc90c9b44d.tar.gz
bluez-098de49acf20f12a925cea8bf4b0d2bc90c9b44d.tar.xz
bluez-098de49acf20f12a925cea8bf4b0d2bc90c9b44d.zip
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.
Diffstat (limited to 'attrib/client.c')
-rw-r--r--attrib/client.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/attrib/client.c b/attrib/client.c
index f1c26c46..b5282c27 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);