fix(arc): fix memory leak in lv_draw_sw_arc (#5245)

This commit is contained in:
Gabor Kiss-Vamosi
2024-01-09 17:34:39 +01:00
committed by GitHub
parent 4699f2f556
commit 254f537a2b

View File

@@ -118,11 +118,11 @@ void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, c
blend_dsc.opa = dsc->opa;
blend_dsc.blend_area = &blend_area;
blend_dsc.mask_area = &blend_area;
lv_image_decoder_dsc_t decoder_dsc;
if(dsc->img_src == NULL) {
blend_dsc.color = dsc->color;
}
else {
lv_image_decoder_dsc_t decoder_dsc;
lv_image_decoder_open(&decoder_dsc, dsc->img_src, NULL);
img_area.x1 = 0;
img_area.y1 = 0;
@@ -198,6 +198,7 @@ void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, c
}
lv_free(mask_buf);
if(dsc->img_src) lv_image_decoder_close(&decoder_dsc);
if(circle_mask) lv_free(circle_mask);
#else
LV_LOG_WARN("Can't draw arc with LV_DRAW_SW_COMPLEX == 0");