[gtk+] Allow gtk_radio_menu_item_set_group() to be called twice without crashing.



commit 75b0180829b21ef345ac54a33179cae0d4affa34
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 82bc001..8eaab3b 100644
--- a/gtk/gtkradiomenuitem.c
+++ b/gtk/gtkradiomenuitem.c
@@ -164,12 +164,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]