mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
Merge branch 'master' into dev-5.3
This commit is contained in:
commit
ccea31d3ab
@ -164,7 +164,9 @@ void lv_img_set_src(lv_obj_t * img, const void * src_img)
|
||||
|
||||
/* If the new and the old src are the same then it was only a refresh.*/
|
||||
if(ext->src != src_img) {
|
||||
lv_mem_free(ext->src);
|
||||
if(ext->src_type == LV_IMG_SRC_FILE || ext->src_type == LV_IMG_SRC_SYMBOL) {
|
||||
lv_mem_free(ext->src); /*If memory was allocated because of the previous `src_type` then free it*/
|
||||
}
|
||||
char * new_str = lv_mem_alloc(strlen(src_img) + 1);
|
||||
lv_mem_assert(new_str);
|
||||
if(new_str == NULL) return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user