Change screen and memory leak

Dear all,
I am Francesco Pugliese, an electronic engineer. I am using IDO-SMLCD72-V1-2EC display with this project GitHub - wireless-tag-com/8ms-sstar: 8ms sigmastar SSD201/SSD202. There are lvgl library 7.10.1.
I did a project with three screens and I noticed that when I switch from another screen there are leakage of memory(the debug of memory I did with lv_mem_monitor()).
When I switch from another screen I use this paradigm:
lv_obj_clean(lv_scr_act());
create_screen(CONFIG_SCREEN);//tabview_screen = lv_obj_create(NULL, NULL);
lv_scr_load(tabview_screen);
//callback to config screen
commons_view_screen(CONFIG_SCREEN);
lv_obj_del(main_view_screen)//delete previous screen.
Why doesnt’t work? Why is there a leakage of memory?
Let me know please
Thanks in advance
Best Regards
Francesco Pugliese

Hi Francesco,

Do you call lv_style_init() in create_screen? If so it is the problem as LVGL always re-initializes the styles. To solve it you should have a style_init() function in which you initialize the styles on once.