[cairo-commit] cairo/src cairo_gstate.c,1.64,1.65
Carl Worth
commit at pdx.freedesktop.org
Sat Nov 13 19:46:21 PST 2004
Committed by: cworth
Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv14237/src
Modified Files:
cairo_gstate.c
Log Message:
* src/cairo_gstate.c (_cairo_gstate_select_font): Unconditionally
destroy the old font, (otherwise, if the same font was selected
twice in a row, a reference was lost to it, leading to assertion
failures).
Index: cairo_gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_gstate.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- cairo_gstate.c 5 Nov 2004 18:57:50 -0000 1.64
+++ cairo_gstate.c 14 Nov 2004 03:46:18 -0000 1.65
@@ -1992,21 +1992,14 @@
cairo_font_slant_t slant,
cairo_font_weight_t weight)
{
- cairo_unscaled_font_t *tmp;
+ _cairo_unscaled_font_destroy (gstate->font);
- tmp = _cairo_unscaled_font_create (family, slant, weight);
+ gstate->font = _cairo_unscaled_font_create (family, slant, weight);
- if (tmp == NULL)
+ if (gstate->font == NULL)
return CAIRO_STATUS_NO_MEMORY;
- if (gstate->font != tmp)
- {
- if (gstate->font != NULL)
- _cairo_unscaled_font_destroy (gstate->font);
-
- cairo_matrix_set_identity (&gstate->font_matrix);
- gstate->font = tmp;
- }
+ cairo_matrix_set_identity (&gstate->font_matrix);
return CAIRO_STATUS_SUCCESS;
}
More information about the cairo-commit
mailing list