diff options
author | Matthias Clasen <mclasen@redhat.com> | 2011-08-09 02:11:38 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2011-08-15 18:57:57 -0400 |
commit | 43d62c08e36515762c61b7248f9062865b36f116 (patch) | |
tree | 1d02415b639cfb98e8a07afccfc3782ab02ad2f5 /gtk/gtkfontchooser.c | |
parent | 5b9857d9b926c3bd2e514d0418c3dbdf64fd95ae (diff) | |
download | gtk+-43d62c08e36515762c61b7248f9062865b36f116.tar.gz |
Clean up error handling
Diffstat (limited to 'gtk/gtkfontchooser.c')
-rw-r--r-- | gtk/gtkfontchooser.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gtk/gtkfontchooser.c b/gtk/gtkfontchooser.c index 60c71c6e39..4d2e5143b6 100644 --- a/gtk/gtkfontchooser.c +++ b/gtk/gtkfontchooser.c @@ -429,10 +429,13 @@ cursor_changed_cb (GtkTreeView *treeview, gtk_tree_path_free (path); path = NULL; - if (!face || !family) + if (face == NULL || family == NULL) { - g_object_unref (face); - g_object_unref (family); + if (face) + g_object_unref (face); + if (family) + g_object_unref (family); + return; } @@ -450,10 +453,9 @@ cursor_changed_cb (GtkTreeView *treeview, gtk_font_chooser_set_family (fontchooser, family); gtk_font_chooser_set_face (fontchooser, face); - /* Free resources */ - g_object_unref ((gpointer)family); - g_object_unref ((gpointer)face); - pango_font_description_free(desc); + g_object_unref (family); + g_object_unref (face); + pango_font_description_free (desc); g_object_notify (G_OBJECT (fontchooser), "font-name"); } |