summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-06-22 23:19:32 +0200
committerBenjamin Otte <otte@redhat.com>2010-06-22 23:19:32 +0200
commit413ec4b708a511eb2f3866165a35d3a8d97bd326 (patch)
treeffa78f7481788d359bd8cfb9c0f10e357e3f2448
parenta4e292507cf7c2f960d040edd57b56a976c73da6 (diff)
gl: Return a surface from _cairo_surface_create_in_error()
On error, surface creation functions should always return a surface created with _cairo_surface_create_in_error() instead of a new surface in an error state. This simplifies internal code as no refcounting has to be done.
-rw-r--r--src/cairo-gl-surface.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 6755955e..a36d7b7a 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -339,7 +339,8 @@ cairo_gl_surface_create (cairo_device_t *abstract_device,
_cairo_gl_surface_create_scratch (ctx, content, width, height);
if (unlikely (surface->base.status)) {
status = _cairo_gl_context_release (ctx, surface->base.status);
- return &surface->base;
+ cairo_surface_destroy (&surface->base);
+ return _cairo_surface_create_in_error (status);
}
/* Cairo surfaces start out initialized to transparent (black) */