e_gesture_device_del(Ecore_Event_Device_Info *ev)
{
Eina_List *l, *l_next;
- char *data;
+ char *name;
+ E_Gesture_Event_Info *data;
if (ev->clas == ECORE_DEVICE_CLASS_TOUCH)
{
- EINA_LIST_FOREACH_SAFE(gesture->device.touch_devices, l, l_next, data)
+ EINA_LIST_FOREACH_SAFE(gesture->device.touch_devices, l, l_next, name)
{
- if (!strncmp(data, ev->identifier, strlen(ev->identifier) + 1))
+ if (!strncmp(name, ev->identifier, strlen(ev->identifier) + 1))
{
GTINF("%s(%s) device is touch device: remove list\n", ev->name, ev->identifier);
- gesture->device.touch_devices = eina_list_remove(gesture->device.touch_devices, data);
+ gesture->device.touch_devices = eina_list_remove(gesture->device.touch_devices, name);
+ E_FREE(name);
+ }
+ }
+ if (eina_list_count(gesture->device.touch_devices) == 0)
+ {
+ GTWRN("No connected touch device. clean up events in queue cnt:%d", eina_list_count(gesture->event_queue));
+
+ EINA_LIST_FOREACH_SAFE(gesture->event_queue, l, l_next, data)
+ {
+ E_FREE(data->event);
E_FREE(data);
+ gesture->event_queue = eina_list_remove_list(gesture->event_queue, l);
}
}
}