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*/