mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-10 15:10:14 +01:00
boilerplate: Add error checking for cairo_surface_write_to_png
This commit is contained in:
parent
0a54ca2d23
commit
054c28a09d
1 changed files with 8 additions and 1 deletions
|
|
@ -228,6 +228,7 @@ test_paginated_write_to_png (cairo_surface_t *surface,
|
|||
cairo_surface_t *image;
|
||||
cairo_format_t format;
|
||||
test_paginated_closure_t *tpc;
|
||||
cairo_status_t status;
|
||||
|
||||
/* show page first. the automatic show_page is too late for us */
|
||||
/* XXX use cairo_surface_show_page() when that's added */
|
||||
|
|
@ -256,7 +257,13 @@ test_paginated_write_to_png (cairo_surface_t *surface,
|
|||
tpc->height,
|
||||
tpc->stride);
|
||||
|
||||
cairo_surface_write_to_png (image, filename);
|
||||
status = cairo_surface_write_to_png (image, filename);
|
||||
if (status) {
|
||||
CAIRO_BOILERPLATE_LOG ("Error writing %s: %s. Exiting\n",
|
||||
filename,
|
||||
cairo_status_to_string (status));
|
||||
exit (1);
|
||||
}
|
||||
|
||||
cairo_surface_destroy (image);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue