[cairo-commit] cairo/src cairo-gstate.c,1.183,1.184
Carl Worth
commit at pdx.freedesktop.org
Mon Nov 7 10:26:21 PST 2005
Committed by: cworth
Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv3557/src
Modified Files:
cairo-gstate.c
Log Message:
2005-11-07 Carl Worth <cworth at cworth.org>
* src/cairo-gstate.c: (_cairo_gstate_init_copy): Perform copy and
reference in a single step.
* src/cairo-gstate-.c: (_cairo_gstate_fini): Remove unnecessary
checks for NULL before _destroy() functions. Reset pointers to
NULL after _destroy().
Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -d -r1.183 -r1.184
--- cairo-gstate.c 7 Nov 2005 18:17:37 -0000 1.183
+++ cairo-gstate.c 7 Nov 2005 18:26:19 -0000 1.184
@@ -155,11 +155,9 @@
if (status)
return status;
- if (gstate->font_face)
- cairo_font_face_reference (gstate->font_face);
+ gstate->font_face = cairo_font_face_reference (other->font_face);
- if (gstate->scaled_font)
- cairo_scaled_font_reference (gstate->scaled_font);
+ gstate->scaled_font = cairo_scaled_font_reference (other->scaled_font);
_cairo_clip_init_copy (&gstate->clip, &other->clip);
@@ -175,20 +173,19 @@
{
_cairo_stroke_style_fini (&gstate->stroke_style);
- if (gstate->font_face)
- cairo_font_face_destroy (gstate->font_face);
+ cairo_font_face_destroy (gstate->font_face);
+ gstate->font_face = NULL;
- if (gstate->scaled_font)
- cairo_scaled_font_destroy (gstate->scaled_font);
+ cairo_scaled_font_destroy (gstate->scaled_font);
+ gstate->scaled_font = NULL;
_cairo_clip_fini (&gstate->clip);
- if (gstate->target) {
- cairo_surface_destroy (gstate->target);
- gstate->target = NULL;
- }
+ cairo_surface_destroy (gstate->target);
+ gstate->target = NULL;
cairo_pattern_destroy (gstate->source);
+ gstate->source = NULL;
}
void
More information about the cairo-commit
mailing list