summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-30 23:23:14 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-08-30 23:23:14 (GMT)
commit786bc8c736a50d10da921da7ea07f01013b3512f (patch)
tree79e01bce7c02ffef746a3d8f9833821902abfd01 /gfx
parente5f83a6d3f12984758748d70f827c2ad4e68ef0f (diff)
downloadeeshow-786bc8c736a50d10da921da7ea07f01013b3512f.zip
eeshow-786bc8c736a50d10da921da7ea07f01013b3512f.tar.gz
eeshow-786bc8c736a50d10da921da7ea07f01013b3512f.tar.bz2
gfx/diff.c: free bitmaps used for diff
We're now at 0 leaks for eeshow ../../n9/ee/hw/neo900.pro -- diff ../../n9/ee/hw/neo900.pro >/dev/null
Diffstat (limited to 'gfx')
-rw-r--r--gfx/diff.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gfx/diff.c b/gfx/diff.c
index ba8c62a..5140dce 100644
--- a/gfx/diff.c
+++ b/gfx/diff.c
@@ -433,6 +433,8 @@ static cairo_t *make_diff(cairo_t *cr, int cx, int cy, float scale,
}
cairo_surface_mark_dirty(s);
+ free(img_new);
+
return old_cr;
}
@@ -459,6 +461,7 @@ static int diff_end(void *ctx)
s = cairo_get_target(old_cr);
cro_img_write(s, diff->output_name);
+ free(cairo_image_surface_get_data(s));
cro_img_reset(gfx_user(diff->new_gfx));
cro_img_reset(gfx_user(diff->gfx));
@@ -492,11 +495,10 @@ void diff_to_canvas(cairo_t *cr, int cx, int cy, float scale,
cairo_set_source_surface(cr, s, 0, 0);
cairo_paint(cr);
+ free(cairo_image_surface_get_data(s));
+
cairo_surface_destroy(s);
cairo_destroy(old_cr);
-
-// free(img_old);
-// free(img_new);
}