fix(disp): fix infinite recursive SCREEN_LOADED events

This commit is contained in:
Gabor Kiss-Vamosi
2023-12-05 10:27:36 +01:00
parent 4fdc4c20b7
commit ef76206c75

View File

@@ -265,7 +265,6 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
/*Shortcut for immediate load*/
if(time == 0 && delay == 0) {
scr_load_internal(new_scr);
d->scr_to_load = NULL;
if(auto_del) lv_obj_del(act_scr);
return;
}
@@ -482,6 +481,7 @@ static void scr_load_internal(lv_obj_t * scr)
if(d->act_scr) lv_event_send(scr, LV_EVENT_SCREEN_LOAD_START, NULL);
d->act_scr = scr;
d->scr_to_load = NULL;
if(d->act_scr) lv_event_send(scr, LV_EVENT_SCREEN_LOADED, NULL);
if(d->act_scr) lv_event_send(old_scr, LV_EVENT_SCREEN_UNLOADED, NULL);