summaryrefslogtreecommitdiff
path: root/gtk/gtkfontbutton.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2019-09-13 14:28:48 +0200
committerTimm Bäder <mail@baedert.org>2019-09-13 19:21:02 +0200
commit6320bd584993dae611a695c5c596647ab29195ff (patch)
treeea205502a25628b51cc784fe50da9a812cf5a903 /gtk/gtkfontbutton.c
parent86cc7f69259d0b3c4689ac9d14c5b9188be52a8c (diff)
downloadgtk+-6320bd584993dae611a695c5c596647ab29195ff.tar.gz
fontbutton: Shorten clear_font_data a bit
Diffstat (limited to 'gtk/gtkfontbutton.c')
-rw-r--r--gtk/gtkfontbutton.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c
index 72d71a7fb8..79ac0c31ed 100644
--- a/gtk/gtkfontbutton.c
+++ b/gtk/gtkfontbutton.c
@@ -190,23 +190,11 @@ clear_font_data (GtkFontButton *font_button)
{
GtkFontButtonPrivate *priv = gtk_font_button_get_instance_private (font_button);
- if (priv->font_family)
- g_object_unref (priv->font_family);
- priv->font_family = NULL;
-
- if (priv->font_face)
- g_object_unref (priv->font_face);
- priv->font_face = NULL;
-
- if (priv->font_desc)
- pango_font_description_free (priv->font_desc);
- priv->font_desc = NULL;
-
- g_free (priv->fontname);
- priv->fontname = NULL;
-
- g_free (priv->font_features);
- priv->font_features = NULL;
+ g_clear_object (&priv->font_family);
+ g_clear_object (&priv->font_face);
+ g_clear_pointer (&priv->font_desc, pango_font_description_free);
+ g_clear_pointer (&priv->fontname, g_free);
+ g_clear_pointer (&priv->font_features, g_free);
}
static void