[Xfce4-commits] <xfwm4:xfce-4.10> Fix crash in settings dialog with wrong title alignment value (bug #9108)

Olivier Fourdan noreply at xfce.org
Thu Jul 19 09:48:02 CEST 2012


Updating branch refs/heads/xfce-4.10
         to f09ea920648d4414c747d390d7cfb2aed230c1e7 (commit)
       from 0b39bbe0b3b5bf514dea223ec96cd25ea4e1444f (commit)

commit f09ea920648d4414c747d390d7cfb2aed230c1e7
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Sun Jul 15 19:28:15 2012 +0200

    Fix crash in settings dialog with wrong title alignment value (bug #9108)

 settings-dialogs/xfwm4-settings.c |   18 ++++++++++--------
 1 files 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);
 }
 
 


More information about the Xfce4-commits mailing list