mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-01 00:51:49 +08:00
fix(sdl): remove the display when the window is closed
This commit is contained in:
@@ -226,7 +226,7 @@ static void sdl_event_handler(lv_timer_t * t)
|
|||||||
lv_refr_now(disp);
|
lv_refr_now(disp);
|
||||||
break;
|
break;
|
||||||
case SDL_WINDOWEVENT_CLOSE:
|
case SDL_WINDOWEVENT_CLOSE:
|
||||||
clean_up(disp);
|
lv_display_remove(disp);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -167,6 +167,9 @@ void lv_display_remove(lv_display_t * disp)
|
|||||||
lv_obj_delete(disp->bottom_layer);
|
lv_obj_delete(disp->bottom_layer);
|
||||||
disp->bottom_layer = NULL;
|
disp->bottom_layer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disp->act_scr = NULL;
|
||||||
|
|
||||||
while(disp->screen_cnt != 0) {
|
while(disp->screen_cnt != 0) {
|
||||||
/*Delete the screenst*/
|
/*Delete the screenst*/
|
||||||
lv_obj_delete(disp->screens[0]);
|
lv_obj_delete(disp->screens[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user