[gtk+/gtk-3-10] Allow gtk_radio_menu_item_set_group() to be called twice without crashing.



commit 81a5243a4734b2d3b47cb9fa18412d7c5f9587ca
Author: John Lindgren <john lindgren aol com>
Date:   Fri Mar 21 23:12:04 2014 -0400

    Allow gtk_radio_menu_item_set_group() to be called twice without crashing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726859

 gtk/gtkradiomenuitem.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkradiomenuitem.c b/gtk/gtkradiomenuitem.c
index 122d7d2..8733cef 100644
--- a/gtk/gtkradiomenuitem.c
+++ b/gtk/gtkradiomenuitem.c
@@ -166,12 +166,14 @@ gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item,
   GtkRadioMenuItemPrivate *priv;
   GtkWidget *old_group_singleton = NULL;
   GtkWidget *new_group_singleton = NULL;
-  
+
   g_return_if_fail (GTK_IS_RADIO_MENU_ITEM (radio_menu_item));
-  g_return_if_fail (!g_slist_find (group, radio_menu_item));
 
   priv = radio_menu_item->priv;
 
+  if (priv->group == group)
+    return;
+
   if (priv->group)
     {
       GSList *slist;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]