mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-16 16:54:38 +08:00
Fix disconnection when multiple watchers are registered
GAttrib ref counter shall be used to control when the remote shall be disconnected. Ref counter is incremented when the watcher is registered and decremented when it leaves the bus.
This commit is contained in:
parent
6b2fea1f37
commit
2eb3b72ac4
@ -214,10 +214,13 @@ static void watcher_exit(DBusConnection *conn, void *user_data)
|
||||
{
|
||||
struct watcher *watcher = user_data;
|
||||
struct primary *prim = watcher->prim;
|
||||
struct gatt_service *gatt = prim->gatt;
|
||||
|
||||
DBG("%s watcher %s exited", prim->path, watcher->name);
|
||||
|
||||
prim->watchers = g_slist_remove(prim->watchers, watcher);
|
||||
|
||||
g_attrib_unref(gatt->attrib);
|
||||
}
|
||||
|
||||
static int characteristic_set_value(struct characteristic *chr,
|
||||
|
Loading…
Reference in New Issue
Block a user