From 2d2f8afb33ca94927b16a05f183737ec8cfd6455 Mon Sep 17 00:00:00 2001 From: Liu Date: Mon, 16 Sep 2024 22:57:27 +0800 Subject: [PATCH] fix(platform): fbapp driver memory leak --- lib/platform/src/linux/fb_app.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/platform/src/linux/fb_app.c b/lib/platform/src/linux/fb_app.c index 0ed2ade17..5b07cb828 100644 --- a/lib/platform/src/linux/fb_app.c +++ b/lib/platform/src/linux/fb_app.c @@ -153,6 +153,13 @@ static void fb_app_init_root_window(void) fbapp.screen_height); } +static void fb_app_destroy_root_window(void) +{ + app_window_t *wnd = &fbapp.window; + + list_destroy(&wnd->rects, free); +} + static void fb_app_init_canvas(void) { fbapp.canvas.width = fbapp.screen_width; @@ -491,6 +498,7 @@ static int fb_app_destroy(void) pd_canvas_destroy(&fbapp.window.canvas); break; } + fb_app_destroy_root_window(); close(fbapp.fb.dev_fd); fbapp.fb.mem = NULL; fbapp.fb.mem_len = 0;