mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix(arc): fix memory leak
This commit is contained in:
parent
1c1b599880
commit
536997c9e8
@ -58,6 +58,8 @@ void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, c
|
||||
if(width > dsc->radius) width = dsc->radius;
|
||||
|
||||
lv_area_t area_out = *coords;
|
||||
lv_area_t clipped_area;
|
||||
if(!_lv_area_intersect(&clipped_area, &area_out, draw_unit->clip_area)) return;
|
||||
|
||||
/*Draw a full ring*/
|
||||
if(dsc->img_src == NULL &&
|
||||
@ -106,9 +108,6 @@ void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, c
|
||||
mask_in_param_valid = true;
|
||||
}
|
||||
|
||||
lv_area_t clipped_area;
|
||||
if(!_lv_area_intersect(&clipped_area, &area_out, draw_unit->clip_area)) return;
|
||||
|
||||
lv_coord_t blend_h = lv_area_get_height(&clipped_area);
|
||||
lv_coord_t blend_w = lv_area_get_width(&clipped_area);
|
||||
lv_coord_t h;
|
||||
|
@ -380,7 +380,7 @@ void lv_draw_sw_mask_radius_init(lv_draw_sw_mask_radius_param_t * param, const l
|
||||
}
|
||||
}
|
||||
|
||||
/*If not found find a free entry with lowest life*/
|
||||
/*If not cached use the free entry with lowest life*/
|
||||
_lv_draw_sw_mask_radius_circle_dsc_t * entry = NULL;
|
||||
for(i = 0; i < LV_DRAW_SW_CIRCLE_CACHE_SIZE; i++) {
|
||||
if(LV_GC_ROOT(_lv_circle_cache[i]).used_cnt == 0) {
|
||||
@ -389,6 +389,7 @@ void lv_draw_sw_mask_radius_init(lv_draw_sw_mask_radius_param_t * param, const l
|
||||
}
|
||||
}
|
||||
|
||||
/*There is no unused entry. Allocate one temporarily*/
|
||||
if(!entry) {
|
||||
entry = lv_malloc(sizeof(_lv_draw_sw_mask_radius_circle_dsc_t));
|
||||
LV_ASSERT_MALLOC(entry);
|
||||
|
@ -9,7 +9,7 @@
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include "../../lv_conf_internal.h"
|
||||
#if LV_USE_STDLIB_MALLOC == LV_STDLIB_CLIB
|
||||
#if LV_USE_STDLIB_SPRINTF == LV_STDLIB_CLIB
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include "../lv_sprintf.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user