Plugged leaking PangoFontDescriptions in gtk_modifier_style_set_font().

This commit is contained in:
Tristan Van Berkom 2011-01-16 21:14:00 +09:00
parent 9438107bff
commit a530f88234

View File

@ -221,7 +221,12 @@ gtk_modifier_style_set_font (GtkModifierStyle *style,
if ((!old_font && !font_desc) ||
(old_font && font_desc &&
pango_font_description_equal (old_font, font_desc)))
return;
{
if (old_font)
pango_font_description_free (old_font);
return;
}
if (font_desc)
gtk_style_properties_set (priv->style, 0,
@ -230,6 +235,9 @@ gtk_modifier_style_set_font (GtkModifierStyle *style,
else
gtk_style_properties_unset_property (priv->style, "font", 0);
if (old_font)
pango_font_description_free (old_font);
g_signal_emit (style, signals[CHANGED], 0);
}