diff --git a/src/dev/sdl/lv_sdl_window.c b/src/dev/sdl/lv_sdl_window.c index 98d88da25..15620186d 100644 --- a/src/dev/sdl/lv_sdl_window.c +++ b/src/dev/sdl/lv_sdl_window.c @@ -375,8 +375,8 @@ static void release_disp_cb(lv_event_t * e) SDL_DestroyTexture(dsc->texture); SDL_DestroyRenderer(dsc->renderer); SDL_DestroyWindow(dsc->window); - if(dsc->fb1) lv_free(dsc->fb1); - if(dsc->fb2) lv_free(dsc->fb2); + if(dsc->fb1) free(dsc->fb1); + if(dsc->fb2) free(dsc->fb2); lv_free(dsc); lv_display_set_driver_data(disp, NULL); } diff --git a/src/lv_init.c b/src/lv_init.c index 5221f398c..1a3c9c802 100644 --- a/src/lv_init.c +++ b/src/lv_init.c @@ -300,6 +300,8 @@ void lv_deinit(void) return; } + if(lv_deinit_in_progress) return; + lv_deinit_in_progress = true; #if LV_USE_SYSMON