summaryrefslogtreecommitdiff
path: root/test/cairo-test.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-05-08 14:01:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2007-05-08 16:47:40 +0100
commitb85920684f8feaba8d2d5b0262c60b4960c223b8 (patch)
treef4ca1b2301f16756f1d686a3cbf9e21ea1631c35 /test/cairo-test.c
parent0bf3ffacda5dbfc4fd8a5a0d5fd37d9630f5bcdb (diff)
[cairo-test] Destroy the check image on failure
If drawing the checker pattern should fail, we need to free the resources allocated locally.
Diffstat (limited to 'test/cairo-test.c')
-rwxr-xr-xtest/cairo-test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 7bc5dd65..3a920502 100755
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -680,8 +680,10 @@ cairo_test_paint_checkered (cairo_t *cr)
check = cairo_image_surface_create (CAIRO_FORMAT_RGB24, 12, 12);
status = _draw_check (check, 12, 12);
- if (status)
+ if (status) {
+ cairo_surface_destroy (check);
return status;
+ }
cairo_save (cr);
cairo_set_source_surface (cr, check, 0, 0);