From nobody Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 13 Jun 2006 16:43:38 -0700 Subject: [PATCH] Bug 4186: Rework cairo_surface_finish to not miss anything due to early return. --- src/cairo-surface.c | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-) 4f65dfaccc4e339d61c1e399cdc2bb24a0f93f42 diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 3218607..2b62ceb 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -411,23 +411,17 @@ cairo_surface_finish (cairo_surface_t *s return; } - if (surface->backend->finish == NULL) { - surface->finished = TRUE; - return; - } - if (!surface->status && surface->backend->flush) { status = surface->backend->flush (surface); - if (status) { + if (status) _cairo_surface_set_error (surface, status); - return; - } } - status = surface->backend->finish (surface); - if (status) { - _cairo_surface_set_error (surface, status); - return; + if (surface->backend->finish) { + status = surface->backend->finish (surface); + if (status) { + _cairo_surface_set_error (surface, status); + } } surface->finished = TRUE; -- 1.3.2.g639c