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:
Gabor Kiss-Vamosi
2020-11-02 12:26:31 +01:00
committed by GitHub
parent 01c15a2b2c
commit 4b7fc8f2b3
+1 -2
View File
@@ -158,8 +158,7 @@ void lv_group_remove_obj(lv_obj_t * obj)
{
lv_group_t * g = obj->group_p;
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*/
if(*g->obj_focus == obj) {
/*If this is the only object in the group then focus to nothing.*/