fix(arc): fix memory leak in lv_draw_sw_arc (#5245)
This commit is contained in:
committed by
GitHub
parent
4699f2f556
commit
254f537a2b
@@ -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.opa = dsc->opa;
|
||||||
blend_dsc.blend_area = &blend_area;
|
blend_dsc.blend_area = &blend_area;
|
||||||
blend_dsc.mask_area = &blend_area;
|
blend_dsc.mask_area = &blend_area;
|
||||||
|
lv_image_decoder_dsc_t decoder_dsc;
|
||||||
if(dsc->img_src == NULL) {
|
if(dsc->img_src == NULL) {
|
||||||
blend_dsc.color = dsc->color;
|
blend_dsc.color = dsc->color;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lv_image_decoder_dsc_t decoder_dsc;
|
|
||||||
lv_image_decoder_open(&decoder_dsc, dsc->img_src, NULL);
|
lv_image_decoder_open(&decoder_dsc, dsc->img_src, NULL);
|
||||||
img_area.x1 = 0;
|
img_area.x1 = 0;
|
||||||
img_area.y1 = 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);
|
lv_free(mask_buf);
|
||||||
|
if(dsc->img_src) lv_image_decoder_close(&decoder_dsc);
|
||||||
if(circle_mask) lv_free(circle_mask);
|
if(circle_mask) lv_free(circle_mask);
|
||||||
#else
|
#else
|
||||||
LV_LOG_WARN("Can't draw arc with LV_DRAW_SW_COMPLEX == 0");
|
LV_LOG_WARN("Can't draw arc with LV_DRAW_SW_COMPLEX == 0");
|
||||||
|
|||||||
Reference in New Issue
Block a user