Description
a win have a button when i click it, it creat a new win, at the sametime i want to close the parent win how to?
What MCU/Processor/Board and compiler are you using?
HiSilicon ARM
What do you want to achieve?
What have you tried so far?
at lvgl 5.3 i call this function is ok,but at 6.0 is segment fault
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
static lv_res_t close_former_win(lv_obj_t * btn)
{
lv_obj_t * btnwin;
printf("btn %p\n",btn);
printf("Press\n");
lv_obj_t * win = lv_win_get_from_btn(btn);
btnwin = lv_obj_get_parent(win);
printf("the win title is %s\n",lv_win_get_title(btnwin));
lv_obj_del(win);
lv_obj_del(btnwin);
return LV_RES_OK;
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.