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.
This commit is contained in:
Benjamin Otte 2010-06-22 23:19:32 +02:00
parent a4e292507c
commit 413ec4b708

View file

@ -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) */