From 3e2df1c3044beb54b19b3e7bb4c78606c8c7a458 Mon Sep 17 00:00:00 2001 From: Mike Massonnet Date: Sun, 15 Jul 2012 19:28:15 +0200 Subject: [PATCH] Fix crash in settings dialog with wrong title alignment value (bug #9108) --- settings-dialogs/xfwm4-settings.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/settings-dialogs/xfwm4-settings.c b/settings-dialogs/xfwm4-settings.c index 711bce0..212e4e7 100644 --- a/settings-dialogs/xfwm4-settings.c +++ b/settings-dialogs/xfwm4-settings.c @@ -1591,17 +1591,19 @@ xfwm_settings_title_button_alignment_changed (GtkComboBox *combo, float align = 0.5f; model = gtk_combo_box_get_model (combo); - gtk_combo_box_get_active_iter (combo, &iter); - gtk_tree_model_get (model, &iter, 1, &value, -1); + if (gtk_combo_box_get_active_iter (combo, &iter)) + { + gtk_tree_model_get (model, &iter, 1, &value, -1); - if (g_str_equal (value, "left")) - align = 0.0f; - else if (g_str_equal (value, "right")) - align = 1.0f; + if (g_str_equal (value, "left")) + align = 0.0f; + else if (g_str_equal (value, "right")) + align = 1.0f; - gtk_button_set_alignment (GTK_BUTTON (button), align, 0.5f); + g_free (value); + } - g_free (value); + gtk_button_set_alignment (GTK_BUTTON (button), align, 0.5f); } -- 1.7.10.4