Description
In version 8.3 lv_img_set_src() The function opens the “xxx.bin” Image file in the external Flash. After switching pages, the memory occupied by this picture will not be released. If this operation is repeated multiple times, it will cause memory overflow and eventually lead to program crash.
When creating a page, use the method of lv_obj_create(NULL) to create the parent object.
May I ask if there is a way to solve this problem? Currently, we are using the c array method to read the image.
What LVGL version are you using?
8.3
What do you want to achieve?
After the page switch, the resources occupied by the pictures should be released.
What have you tried so far?
When switching pages, attempts to retain the current page and to clear the current interface have not worked. Neither lv_obj_del nor lv_obj_clean can solve the problem.
Code to reproduce
typedef struct{
…
lv_obj_t *About;
lv_obj_t *About_img_Logo;
…
}lv_ui;
lv_ui mygui;
void scr_About()
{
mygui.About = lv_obj_creat(NULL);
mygui.About_img_Logo = lv_img_creat(mygui.About);
lv_img_set_src(mygui.About_img_Logo ,“F:Logo.bin”);
lv_obj_set_pos(…);
lv_obj_set_size(…);
}