diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-01-16 16:29:19 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-01-16 16:40:01 +0000 |
commit | 5cbc45488e276cb6e6ecfa7bc7dd4fae342de85e (patch) | |
tree | 672c700de47687c25c68cb22743c0a058e4b06d1 /src/cairo-deflate-stream.c | |
parent | 2c10c7559db11ccf511e119f4d4fb2da97508786 (diff) | |
download | cairo-5cbc45488e276cb6e6ecfa7bc7dd4fae342de85e.tar.gz |
[cairo-output-stream] Introduce _cairo_output_stream_create_in_error()
Use a utility function to wrap an incoming error status into a new
error stream. As a side-effect, all error streams must be destroyed as
in the general case the caller can not distinguish between a static
error object and one allocated to hold an unusual error status.
Diffstat (limited to 'src/cairo-deflate-stream.c')
-rw-r--r-- | src/cairo-deflate-stream.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/cairo-deflate-stream.c b/src/cairo-deflate-stream.c index 707832db4..8734b1782 100644 --- a/src/cairo-deflate-stream.c +++ b/src/cairo-deflate-stream.c @@ -117,11 +117,8 @@ _cairo_deflate_stream_create (cairo_output_stream_t *output) { cairo_deflate_stream_t *stream; - if (output->status) { - _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); - return (cairo_output_stream_t *) &_cairo_output_stream_nil; - } - + if (output->status) + return _cairo_output_stream_create_in_error (output->status); stream = malloc (sizeof (cairo_deflate_stream_t)); if (stream == NULL) { |