summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-09 10:24:08 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-09 10:24:08 -0300
commit86543759f68ce22ccbf285f009c8dc564bba127a (patch)
tree33c2eb68647b86a64c465670b79a2bf0268ae39c /diff.c
parent34d7e31f53110b0b4de3d3c51faa8103600b4a3f (diff)
downloadeeshow-86543759f68ce22ccbf285f009c8dc564bba127a.tar.gz
eeshow-86543759f68ce22ccbf285f009c8dc564bba127a.tar.bz2
eeshow-86543759f68ce22ccbf285f009c8dc564bba127a.zip
eeshow/diff.c: free list of highlighted areas
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 728198e..2eee314 100644
--- a/diff.c
+++ b/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);