mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-04 02:28:02 +02:00
Don't destroy a NULL font.
This commit is contained in:
parent
2b76ec2d46
commit
78f1206bf8
3 changed files with 9 additions and 4 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2004-11-14 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* src/cairo_gstate.c (_cairo_gstate_select_font): Don't destroy a
|
||||
NULL font.
|
||||
|
||||
2004-11-13 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* src/cairo_gstate.c (_cairo_gstate_select_font): Unconditionally
|
||||
|
|
|
|||
|
|
@ -1992,10 +1992,10 @@ _cairo_gstate_select_font (cairo_gstate_t *gstate,
|
|||
cairo_font_slant_t slant,
|
||||
cairo_font_weight_t weight)
|
||||
{
|
||||
_cairo_unscaled_font_destroy (gstate->font);
|
||||
if (gstate->font)
|
||||
_cairo_unscaled_font_destroy (gstate->font);
|
||||
|
||||
gstate->font = _cairo_unscaled_font_create (family, slant, weight);
|
||||
|
||||
if (gstate->font == NULL)
|
||||
return CAIRO_STATUS_NO_MEMORY;
|
||||
|
||||
|
|
|
|||
|
|
@ -1992,10 +1992,10 @@ _cairo_gstate_select_font (cairo_gstate_t *gstate,
|
|||
cairo_font_slant_t slant,
|
||||
cairo_font_weight_t weight)
|
||||
{
|
||||
_cairo_unscaled_font_destroy (gstate->font);
|
||||
if (gstate->font)
|
||||
_cairo_unscaled_font_destroy (gstate->font);
|
||||
|
||||
gstate->font = _cairo_unscaled_font_create (family, slant, weight);
|
||||
|
||||
if (gstate->font == NULL)
|
||||
return CAIRO_STATUS_NO_MEMORY;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue