[cairo-commit] src/cairo-surface.c

Carl Worth cworth at kemper.freedesktop.org
Thu Feb 1 16:06:14 PST 2007


 src/cairo-surface.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

New commits:
diff-tree c621201a41639be8ba9ee735c2859aa117ba4216 (from 159359325d4f8306feef6bebabecb31cbf0b9bf5)
Author: Carl Worth <cworth at cworth.org>
Date:   Thu Feb 1 16:05:59 2007 -0800

    Don't finish a finished surface in cairo_surface_destroy
    
    Calling cairo_surface_finish from cairo_surface_destroy was
    triggering an error due to finish being called twice. The
    error was usually hidden as the surface would still eventually
    be destroyed. But it did clutter things up quite badly if a
    user was trying to break on _cairo_error to track down a
    problem.
    
    Thanks again to Stuart Parmenter <stuartp at gmail.com>
    for pointing out the problem.

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 07f7439..1541e6d 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -444,7 +444,8 @@ cairo_surface_destroy (cairo_surface_t *
     if (surface->ref_count)
 	return;
 
-    cairo_surface_finish (surface);
+    if (! surface->finished)
+	cairo_surface_finish (surface);
 
     _cairo_user_data_array_fini (&surface->user_data);
 


More information about the cairo-commit mailing list