mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-03 14:00:18 +01:00
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:
parent
a4e292507c
commit
413ec4b708
1 changed files with 2 additions and 1 deletions
|
|
@ -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) */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue