diff --git a/lv_core/lv_obj.c b/lv_core/lv_obj.c index c7c84e57a..a0bbbf9ae 100644 --- a/lv_core/lv_obj.c +++ b/lv_core/lv_obj.c @@ -292,17 +292,9 @@ lv_res_t lv_obj_del(lv_obj_t * obj) /* Reset all input devices if * the currently pressed object is deleted*/ lv_indev_t * indev = lv_indev_next(NULL); - lv_obj_t * dpar; while(indev) { - dpar = obj; - while(dpar != NULL) { - if(indev->proc.act_obj == dpar || - indev->proc.last_obj == dpar) { - lv_indev_reset(indev); - break; - } else { - dpar = lv_obj_get_parent(dpar); - } + if(indev->proc.act_obj == obj || indev->proc.last_obj == obj) { + lv_indev_reset(indev); } indev = lv_indev_next(indev); } @@ -1591,6 +1583,16 @@ static void delete_children(lv_obj_t * obj) if(obj->group_p != NULL) lv_group_remove_obj(obj); #endif + /* Reset the input devices if + * the currently pressed object is deleted*/ + lv_indev_t * indev = lv_indev_next(NULL); + while(indev) { + if(indev->proc.act_obj == obj || indev->proc.last_obj == obj) { + lv_indev_reset(indev); + } + indev = lv_indev_next(indev); + } + /*Remove the object from parent's children list*/ lv_obj_t * par = lv_obj_get_parent(obj); lv_ll_rem(&(par->child_ll), obj); diff --git a/lv_objx/lv_ta.c b/lv_objx/lv_ta.c index 931614bb4..86c5ce199 100644 --- a/lv_objx/lv_ta.c +++ b/lv_objx/lv_ta.c @@ -1044,7 +1044,10 @@ static void pwd_char_hider(lv_obj_t * ta) int16_t len = lv_txt_get_length(txt); bool refr = false; uint16_t i; - for(i = 0; i < len; i++) txt[i] = '*'; + for(i = 0; i < len; i++) { + txt[i] = '*'; + refr = true; + } txt[i] = '\0';