fix(decoder): do not put image to cache if args say no (#5111)
Signed-off-by: Xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
@@ -386,6 +386,8 @@ static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_d
|
||||
break;
|
||||
}
|
||||
|
||||
if(dsc->args.no_cache) return LV_RES_OK;
|
||||
|
||||
#if LV_CACHE_DEF_SIZE > 0
|
||||
if(res == LV_RESULT_OK) {
|
||||
lv_image_cache_data_t search_key;
|
||||
@@ -421,11 +423,10 @@ static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t *
|
||||
{
|
||||
LV_UNUSED(decoder); /*Unused*/
|
||||
|
||||
#if LV_CACHE_DEF_SIZE > 0
|
||||
lv_cache_release(dsc->cache, dsc->cache_entry, NULL);
|
||||
#else
|
||||
decoder_draw_buf_free((lv_draw_buf_t *)dsc->decoded);
|
||||
#endif
|
||||
if(dsc->args.no_cache || LV_CACHE_DEF_SIZE == 0)
|
||||
lv_draw_buf_destroy((lv_draw_buf_t *)dsc->decoded);
|
||||
else
|
||||
lv_cache_release(dsc->cache, dsc->cache_entry, NULL);
|
||||
}
|
||||
|
||||
static void decoder_cache_free(lv_image_cache_data_t * cached_data, void * user_data)
|
||||
|
||||
Reference in New Issue
Block a user