[cairo-commit] libsvg/src svg_pattern.c,1.2,1.3

Keith Packard commit at pdx.freedesktop.org
Thu May 12 22:30:33 PDT 2005


Committed by: keithp

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

Modified Files:
	svg_pattern.c 
Log Message:
2005-05-12  Keith Packard  <keithp at keithp.com>

	reviewed by: <delete if not using a buddy>

	* src/svg_pattern.c: (_svg_pattern_init_copy),
	(_svg_pattern_deinit):
	Make pattern_init_copy clone the element instead of
	doing bad things.  Free the element when deiniting the pattern.


Index: svg_pattern.c
===================================================================
RCS file: /cvs/cairo/libsvg/src/svg_pattern.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- svg_pattern.c	11 Apr 2005 16:20:09 -0000	1.2
+++ svg_pattern.c	13 May 2005 05:30:31 -0000	1.3
@@ -51,8 +51,19 @@
 _svg_pattern_init_copy (svg_pattern_t *pattern,
 			svg_pattern_t *other)
 {
-    *pattern = *other;
-    _svg_element_init_copy (pattern->group_element, other->group_element);
+    svg_status_t    status;
+
+    status = _svg_element_clone (&pattern->group_element, other->group_element);
+    if (status)
+	return status;
+
+    pattern->units = other->units;
+    pattern->content_units = other->content_units;
+    pattern->x = other->x;
+    pattern->y = other->y;
+    pattern->width = other->width;
+    pattern->height = other->height;
+    memcpy (pattern->transform, other->transform, sizeof (pattern->transform));
 
     return SVG_STATUS_SUCCESS;
 }
@@ -60,7 +71,9 @@
 svg_status_t
 _svg_pattern_deinit (svg_pattern_t *pattern)
 {
-    return _svg_element_deinit (pattern->group_element);
+    _svg_element_destroy (pattern->group_element);
+    pattern->group_element = NULL;
+    return SVG_STATUS_SUCCESS;
 }
 
 svg_status_t




More information about the cairo-commit mailing list