From e06285e7a54c44cc69652a372b2afcf06740adef Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 30 Nov 2023 13:36:55 +0100 Subject: [PATCH] fix(sdl): use stdlib malloc/free for framebuffer allocation --- src/dev/sdl/lv_sdl_window.c | 4 ++-- src/lv_init.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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