[cairo-commit:00160] rcairo/rcairo [master] surface: don't finish when the surface is already errored

null+rcairo at clear-code.com null+rcairo at clear-code.com
Sun Mar 25 08:34:29 UTC 2012


Kouhei Sutou	2012-03-25 17:34:29 +0900 (Sun, 25 Mar 2012)

  New Revision: 73ae35bf7f6d5f7e61919d5a60c76d5cd7439792

  Log:
    surface: don't finish when the surface is already errored

  Modified files:
    ext/cairo/rb_cairo_surface.c

  Modified: ext/cairo/rb_cairo_surface.c (+6 -2)
===================================================================
--- ext/cairo/rb_cairo_surface.c    2012-03-25 16:58:54 +0900 (9fabc98)
+++ ext/cairo/rb_cairo_surface.c    2012-03-25 17:34:29 +0900 (df07e15)
@@ -320,8 +320,12 @@ yield_and_finish (VALUE self)
   rb_yield (self);
 
   surface = _SELF;
-  if (!cairo_surface_get_user_data (surface, &cr_finished_key))
-    cr_surface_finish (self);
+  if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
+    return;
+  if (cairo_surface_get_user_data (surface, &cr_finished_key))
+    return;
+
+  cr_surface_finish (self);
 }
 
 static VALUE



More information about the cairo-commit mailing list