Skip to content

Commit

Permalink
fix memory leak of spangroup (#2285)
Browse files Browse the repository at this point in the history
Co-authored-by: guowei15 <guowei15@xiaomi.com>
guoweilkd and guowei15 authored Jun 3, 2021
1 parent 38ebcd8 commit 33e0926
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/extra/widgets/span/lv_span.c
Original file line number Diff line number Diff line change
@@ -137,6 +137,7 @@ void lv_spangroup_del_span(lv_obj_t * obj, lv_span_t * span)
if(cur_span->txt && cur_span->static_flag == 0) {
lv_mem_free(cur_span->txt);
}
lv_style_reset(&cur_span->style);
lv_mem_free(cur_span);
break;
}
@@ -501,6 +502,7 @@ static void lv_spangroup_destructor(const lv_obj_class_t * class_p, lv_obj_t * o
if(cur_span->txt && cur_span->static_flag == 0) {
lv_mem_free(cur_span->txt);
}
lv_style_reset(&cur_span->style);
lv_mem_free(cur_span);
cur_span = _lv_ll_get_head(&spans->child_ll);
}

0 comments on commit 33e0926

Please sign in to comment.