From 029cc30700233243f15bff0a940de2f587775fe9 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 9 Aug 2016 10:24:08 -0300 Subject: [PATCH] eeshow/diff.c: free list of highlighted areas --- eeshow/diff.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/eeshow/diff.c b/eeshow/diff.c index 728198e..2eee314 100644 --- a/eeshow/diff.c +++ b/eeshow/diff.c @@ -261,6 +261,18 @@ static void show_areas(struct diff *diff, uint32_t *a) } +static void free_areas(struct diff *diff) +{ + struct area *next; + + while (diff->areas) { + next = diff->areas->next; + free(diff->areas); + diff->areas = next; + } +} + + static void diff_end(void *ctx) { struct diff *diff = ctx; @@ -276,6 +288,7 @@ static void diff_end(void *ctx) differences(diff, old_img, diff->new_img); show_areas(diff, old_img); + free_areas(diff); cro_img_write(diff->cr_ctx, diff->output_name); } @@ -352,6 +365,8 @@ void diff_to_canvas(cairo_t *cr, int cx, int cy, float scale, show_areas(&diff, img_old); cairo_surface_mark_dirty(s); + free_areas(&diff); + cairo_set_source_surface(cr, s, 0, 0); cairo_paint(cr);