BigW Consortium Gitlab

Commit 8bc5770c by Gabor Kiss-Vamosi

lv_del_obj: fix if delted while pressed

parent 913517f1
......@@ -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);
......
......@@ -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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment