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

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


Updating branch refs/heads/master
         to aa75f33e8dc2343df631a0a296e9ef54ea8a88ed (commit)
       from 099614e3f045e06db7ab509e174510ea74857adb (commit)

commit aa75f33e8dc2343df631a0a296e9ef54ea8a88ed
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