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:
Claudio Takahasi 2010-09-20 17:40:03 -03:00 committed by Anderson Lizardo
parent 6b2fea1f37
commit 2eb3b72ac4

View File

@ -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,