From bf7641addc17fd43a6f04be6a7a34bfa297e5544 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 21 Aug 2001 20:18:49 +0000 Subject: Fix a leak: unref the EFont after we have used it. Also, don't crash if * e-shell-folder-title-bar.c (label_realize_callback): Fix a leak: unref the EFont after we have used it. Also, don't crash if `e_font_to_gdk_font()' returns NULL. [This should fix #7666, Folder View crashes Evo.] svn path=/trunk/; revision=12353 --- shell/ChangeLog | 7 +++++++ shell/e-shell-folder-title-bar.c | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index df80470579..c8685b82c0 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,10 @@ +2001-08-21 Ettore Perazzoli + + * e-shell-folder-title-bar.c (label_realize_callback): Fix a leak: + unref the EFont after we have used it. Also, don't crash if + `e_font_to_gdk_font()' returns NULL. [This should fix #7666, + Folder View crashes Evo.] + 2001-08-21 Iain Holmes * e-shell-importer.c (start_import): Don't print a NULL. diff --git a/shell/e-shell-folder-title-bar.c b/shell/e-shell-folder-title-bar.c index 836da098cb..1ed1dcca6e 100644 --- a/shell/e-shell-folder-title-bar.c +++ b/shell/e-shell-folder-title-bar.c @@ -147,9 +147,12 @@ label_realize_callback (GtkWidget *widget, e_font = e_font_from_gdk_font (style->font); bolded_font = e_font_to_gdk_font (e_font, E_FONT_BOLD); + e_font_unref (e_font); - gdk_font_unref (style->font); - style->font = bolded_font; + if (bolded_font != NULL) { + gdk_font_unref (style->font); + style->font = bolded_font; + } gtk_style_attach (style, widget->window); -- cgit v1.2.3