diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-03-21 20:40:54 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-03-21 20:40:54 +0000 |
commit | a7cb314b060f6ada855ec75b283ef64bf835824a (patch) | |
tree | 8d4561fa38ad779ff223fafa2606295c7e4487cd /test/any2ppm.c | |
parent | b73a33b89e43d63a437035a05cf91df5c3b4d186 (diff) |
test/any2ppm: Check for errors after executing script.
Diffstat (limited to 'test/any2ppm.c')
-rw-r--r-- | test/any2ppm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/any2ppm.c b/test/any2ppm.c index a7bb49a6..55b4c7ec 100644 --- a/test/any2ppm.c +++ b/test/any2ppm.c @@ -273,11 +273,14 @@ _cairo_script_render_page (const char *filename, csi = cairo_script_interpreter_create (); cairo_script_interpreter_install_hooks (csi, &hooks); - cairo_script_interpreter_run (csi, filename); + status = cairo_script_interpreter_run (csi, filename); + if (status) { + cairo_surface_destroy (surface); + surface = NULL; + } status = cairo_script_interpreter_destroy (csi); - if (surface == NULL) { + if (surface == NULL) return "cairo-script interpreter failed"; - } if (status == CAIRO_STATUS_SUCCESS) status = cairo_surface_status (surface); |