test_efl_anim_interpolator: delete animation event callback on window delete

elementary_test Efl.Animation.Interpolator test performs Invalid
memory access if the window is closed during the animation. This can
lead to elm_test crashing after the main window is closed.

In order to avoid this invalid memory access, when the window gets
deleted we can delete the efl_event_callback so that the event does
not fire while the window is being deleted.

ref T7392

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Differential Revision: https://phab.enlightenment.org/D7644
This commit is contained in:
Christopher Michael 2019-01-16 10:07:12 -05:00 committed by Derek Foreman
parent 6c8ab3fabc
commit bff4c35322
1 changed files with 10 additions and 0 deletions

View File

@ -139,6 +139,16 @@ static void
_win_del_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
App_Data *ad = data;
int i;
for (i = 0; i < INTERP_NUM; i++)
{
//Unregister callback called when window deletes
efl_event_callback_del(ad->anim_obj[i],
EFL_ANIMATION_PLAYER_EVENT_ENDED,
_anim_ended_cb, ad);
}
free(ad);
}