diff options
author | Benjamin Otte <otte@redhat.com> | 2010-04-20 21:58:59 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-04-23 21:46:12 +0200 |
commit | 3efbc0c5c850d0cb5c5af5bcabbc7293670ea355 (patch) | |
tree | 14be69396606005f1ec1a462529c259dfbed9a79 | |
parent | 64662be4ef3851d21658e5fdb2efb6806b45eba8 (diff) |
gl: Only unref a surface if it exists
Note: This will likely work for NULL clones, but I prefer not
dereferencing NULLs. That gives people a wrong understanding of the code
(i.e. me).
-rw-r--r-- | src/cairo-gl-surface.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c index 1f6fd9ba..24a5142f 100644 --- a/src/cairo-gl-surface.c +++ b/src/cairo-gl-surface.c @@ -881,7 +881,8 @@ fail: _cairo_gl_context_release (ctx); - cairo_surface_destroy (&clone->base); + if (clone) + cairo_surface_destroy (&clone->base); return CAIRO_STATUS_SUCCESS; } |