示例#1
0
文件: hidhost.c 项目: aguedes/bluez
static void hid_device_free(void *data)
{
	struct hid_device *dev = data;

	if (dev->reconnect_id > 0)
		g_source_remove(dev->reconnect_id);

	if (dev->ctrl_watch > 0)
		g_source_remove(dev->ctrl_watch);

	if (dev->intr_watch > 0)
		g_source_remove(dev->intr_watch);

	if (dev->intr_io)
		g_io_channel_unref(dev->intr_io);

	if (dev->ctrl_io)
		g_io_channel_unref(dev->ctrl_io);

	if (dev->uhid)
		bt_uhid_unref(dev->uhid);

	if (dev->hog)
		bt_hog_unref(dev->hog);

	g_free(dev->rd_data);
	g_free(dev);
}
static void hog_device_free(void *data)
{
    struct hog_device *dev = data;

    queue_remove(devices, dev);
    if (queue_isempty(devices)) {
        queue_destroy(devices, NULL);
        devices = NULL;
    }

    btd_device_remove_attio_callback(dev->device, dev->attioid);
    btd_device_unref(dev->device);
    bt_hog_unref(dev->hog);
    free(dev);
}
示例#3
0
static gboolean context_quit(gpointer user_data)
{
	struct context *context = user_data;

	if (context->process > 0)
		g_source_remove(context->process);

	if (context->source > 0)
		g_source_remove(context->source);

	bt_hog_unref(context->hog);

	g_attrib_unref(context->attrib);

	g_free(context);

	tester_test_passed();

	return FALSE;
}