Description
I have created a window without close button, the window is created correctly, but I have noticed that if I want to remove the window programatically, it causes a crash, I have tried both:
lv_obj_del
and lv_obj_del_async
, the first one seems to close the window but immediately afterwards it crashes, the async method, just leave the window opnened without being responsive
What MCU/Processor/Board and compiler are you using?
ESP32 4MB PSRAM, 16MG Flash
What LVGL version are you using?
7.10.1
What do you want to achieve?
I would like to close a window object programatically without crashing
What have you tried so far?
I have use both async and not async methods to delete the window object
Code to reproduce
The code block(s) should be formatted like:
lv_obj_t * win_req;
void password_req_win(void){
unlockTimer = millis();
win_req = lv_win_create(lv_scr_act(), NULL);
lv_win_set_title(win_req, "Unlock");
cont = lv_cont_create(win_req, NULL);
lv_obj_set_auto_realign(cont, true); /*Auto realign when the size changes*/
lv_obj_align_origo(cont, NULL, LV_ALIGN_CENTER, 0,0); /*This parametrs will be sued when realigned*/
lv_cont_set_fit(cont, LV_FIT_TIGHT);
lv_cont_set_layout(cont, LV_LAYOUT_COLUMN_MID);
lv_obj_t * oneline_ta = lv_textarea_create(cont, NULL);
lv_textarea_set_pwd_mode(oneline_ta, false);
lv_textarea_set_one_line(oneline_ta, true);
lv_textarea_set_cursor_hidden(oneline_ta, false);
lv_textarea_set_cursor_blink_time(oneline_ta, 500);
lv_textarea_set_text(oneline_ta, "");
lv_obj_set_event_cb(oneline_ta, ta_event_unlock_cb);
lv_obj_set_size(oneline_ta,140, 35);
}
void loop()
{
if( (millis() - unlockTimer) > 7000 && unlockTimer != 0){
windowOpened = false;
if (kbOpened == true) {
lv_keyboard_set_textarea(kb, NULL); /*De-assign the text area to hide it cursor if needed*/
lv_obj_del(kb);
kbOpened = false;
}
lv_obj_del(win_req); // removing the window here
}
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.