diff --git a/src/libei-device.c b/src/libei-device.c index d3a177a..7142ed3 100644 --- a/src/libei-device.c +++ b/src/libei-device.c @@ -572,7 +572,8 @@ OBJECT_IMPLEMENT_SETTER(ei_touch, user_data, void *); static void ei_touch_destroy(struct ei_touch *touch) { - ei_touch_up(touch); + if (touch->state == TOUCH_IS_DOWN) + ei_touch_up(touch); ei_device_unref(touch->device); } diff --git a/src/libeis-device.c b/src/libeis-device.c index 6599bbb..5ea4399 100644 --- a/src/libeis-device.c +++ b/src/libeis-device.c @@ -529,7 +529,8 @@ OBJECT_IMPLEMENT_SETTER(eis_touch, user_data, void *); static void eis_touch_destroy(struct eis_touch *touch) { - eis_touch_up(touch); + if (touch->state == TOUCH_IS_DOWN) + eis_touch_up(touch); eis_device_unref(touch->device); }