mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-27 03:25:28 +08:00
group: fix in lv_group_remove_obj to handle deleting hidden objects correctly
Fixes: https://forum.lvgl.io/t/deleting-hidden-subobjs-in-groups-may-lead-to-crash/3590
This commit is contained in:
committed by
GitHub
parent
01c15a2b2c
commit
4b7fc8f2b3
@@ -158,8 +158,7 @@ void lv_group_remove_obj(lv_obj_t * obj)
|
|||||||
{
|
{
|
||||||
lv_group_t * g = obj->group_p;
|
lv_group_t * g = obj->group_p;
|
||||||
if(g == NULL) return;
|
if(g == NULL) return;
|
||||||
if(g->obj_focus == NULL) return; /*Just to be sure (Not possible if there is at least one object in the group)*/
|
|
||||||
|
|
||||||
/*Focus on the next object*/
|
/*Focus on the next object*/
|
||||||
if(*g->obj_focus == obj) {
|
if(*g->obj_focus == obj) {
|
||||||
/*If this is the only object in the group then focus to nothing.*/
|
/*If this is the only object in the group then focus to nothing.*/
|
||||||
|
|||||||
Reference in New Issue
Block a user