Gesture Layer: fix crash during deletion.

if target object is deleted before GLayer is deleted, we get a crash
from _event_history_clear.
Setting target to NULL on delete, then testing it before reporting state
takes care of this problem.
This commit is contained in:
Aharon Hillel 2013-07-01 18:37:17 +03:00 committed by Daniel Zaoui
parent fab1a003fc
commit 13da4a3a80
1 changed files with 5 additions and 2 deletions

View File

@ -960,6 +960,8 @@ _target_del_cb(void *data,
void *event_info __UNUSED__)
{
_callbacks_unregister(data);
ELM_GESTURE_LAYER_DATA_GET(data, sd);
sd->target = NULL;
}
/**
@ -1165,8 +1167,9 @@ _event_history_clear(Evas_Object *obj)
}
else
{ /* Report ABORT to all gestures that still not finished */
_state_set(p, ELM_GESTURE_STATE_ABORT, sd->gesture[i]->info,
EINA_FALSE);
if (sd->target)
_state_set(p, ELM_GESTURE_STATE_ABORT,
sd->gesture[i]->info, EINA_FALSE);
}
}
}