From 0591dec33a2c0fb23835b91e553e9512fa01e623 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 11 Feb 2021 14:42:48 +0100 Subject: [PATCH] fix(delete): delete animation after the children are deleted New animation can be added during child delete --- CHANGELOG.md | 1 + src/lv_core/lv_obj.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2169b1521..7a709d7e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Bugfixes - fix(indev) clear the indev's `act_obj` in `lv_indev_reset` - fix(text) fix out of bounds read in `_lv_txt_get_width` +- fix(delete) delete animation after the children are deleted because new animation can be added during child delete ## v7.10.0 diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index 4efebbb5d..d83539b29 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -3764,12 +3764,6 @@ static void obj_del_core(lv_obj_t * obj) if(group) lv_group_remove_obj(obj); #endif - /*Remove the animations from this object*/ -#if LV_USE_ANIMATION - lv_anim_del(obj, NULL); - trans_del(obj, 0xFF, 0xFF, NULL); -#endif - /*Delete the user data*/ #if LV_USE_USER_DATA #if LV_USE_USER_DATA_FREE @@ -3788,6 +3782,12 @@ static void obj_del_core(lv_obj_t * obj) i = _lv_ll_get_head(&(obj->child_ll)); } + /*Remove the animations from this object*/ +#if LV_USE_ANIMATION + lv_anim_del(obj, NULL); + trans_del(obj, 0xFF, 0xFF, NULL); +#endif + lv_event_mark_deleted(obj); /* Reset all input devices if the object to delete is used*/