[PATCH] Ensure surface backend finish() is never called more than once.

Adrian Johnson ajohnson at redneon.com
Tue May 15 03:13:42 PDT 2007


Previously if the backend finish() function returned an error status,
surface->finished was not set true. This would result in the backend
finish() function being called twice which in the case of the PostScript
backend caused a seg fault.
---
 src/cairo-surface.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 680ff0c..d7ef33f 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -502,10 +502,8 @@ cairo_surface_finish (cairo_surface_t *s
     }
 
     status = surface->backend->finish (surface);
-    if (status) {
+    if (status)
 	_cairo_surface_set_error (surface, status);
-	return;
-    }
 
     surface->finished = TRUE;
 }
-- 
1.4.3.4


--------------090804020404070801030500--


More information about the cairo mailing list