I have something like this:
lv_obj_t* parent_view = lv_obj_create(NULL, NULL);
lv_font_t* font_label = (lv_font_t*)malloc(sizeof(lv_font_t));
lv_font_fmt_freetype_dsc_t * font_dsc = (lv_font_fmt_freetype_dsc_t*)lv_mem_alloc(sizeof(lv_font_fmt_freetype_dsc_t));
lv_style_t* style_label = (lv_style_t*)malloc(sizeof(lv_style_t));
lv_obj_t* label_view = lv_label_create(parent_view, NULL);
//set style for label_view
...
lv_img_dsc_t* image_dsc = (lv_img_dsc_t*)malloc(sizeof(lv_img_dsc_t));
void* image = (void*)Some_PNG_Decoder();
lv_obj_t * image_view = lv_img_create(parent_view, NULL);
//set image for image_view
lv_style_t* style_parent = = (lv_style_t*)malloc(sizeof(lv_style_t));
//set parent style
...
lv_scr_load(parent_view);
lv_obj_del(parent_view);
As you can see, There are a parent view and two child views here. After displaying them, I want to recycle them. So what I should do to make sure they are properly recycled and no memory leak occurs.
Thanks !