void bt_hog_detach(struct bt_hog *hog) { GSList *l; if (!hog->attrib) return; for (l = hog->instances; l; l = l->next) { struct bt_hog *instance = l->data; bt_hog_detach(instance); } for (l = hog->reports; l; l = l->next) { struct report *r = l->data; if (r->notifyid > 0) { g_attrib_unregister(hog->attrib, r->notifyid); r->notifyid = 0; } } if (hog->scpp) bt_scpp_detach(hog->scpp); if (hog->dis) bt_dis_detach(hog->dis); if (hog->bas) bt_bas_detach(hog->bas); g_attrib_unref(hog->attrib); hog->attrib = NULL; }
static void scpp_free(struct bt_scpp *scan) { bt_scpp_detach(scan); g_free(scan->primary); queue_destroy(scan->gatt_op, (void *) destroy_gatt_req); g_free(scan); }
static void scpp_free(struct bt_scpp *scan) { bt_scpp_detach(scan); g_free(scan->primary); queue_destroy(scan->gatt_op, NULL); /* cleared in bt_scpp_detach */ g_free(scan); }