[cairo-commit] cairo/src cairo_surface.c,1.45,1.46

Kristian Hogsberg commit at pdx.freedesktop.org
Thu Mar 10 09:28:52 PST 2005


Committed by: krh

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv785/src

Modified Files:
	cairo_surface.c 
Log Message:


Index: cairo_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_surface.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- cairo_surface.c	10 Mar 2005 16:59:11 -0000	1.45
+++ cairo_surface.c	10 Mar 2005 17:28:50 -0000	1.46
@@ -138,6 +138,22 @@
     surface->ref_count++;
 }
 
+static void
+_destroy_user_data (cairo_surface_t *surface)
+{
+    int i, num_slots;
+    cairo_user_data_slot_t *slots;
+
+    num_slots = surface->user_data_slots.num_elements;
+    slots = (cairo_user_data_slot_t *) surface->user_data_slots.elements;
+    for (i = 0; i < num_slots; i++) {
+	if (slots[i].user_data != NULL)
+	    slots[i].destroy (slots[i].user_data);
+    }
+
+    _cairo_array_fini (&surface->user_data_slots);
+}
+
 void
 cairo_surface_destroy (cairo_surface_t *surface)
 {
@@ -150,6 +166,8 @@
 
     if (surface->backend->destroy)
 	surface->backend->destroy (surface);
+
+    _destroy_user_data (surface);
 }
 slim_hidden_def(cairo_surface_destroy);
 




More information about the cairo-commit mailing list