GTK comrades, Please review the attached patch. I have run into instances where a stale pointer to the active menu item causes a crash. This fix remedies the situation. If the item being removed is the active menu item, active_menu_item is set to NULL. This patch is similar, yet different, from the patch submitted by Pavel Ciser last week. Thanks! ? patch.diff Index: gtkmenushell.c =================================================================== RCS file: /cvs/gnome/gtk+/gtk/gtkmenushell.c,v retrieving revision 1.27.2.5 diff -p -u -r1.27.2.5 gtkmenushell.c --- gtkmenushell.c 2000/02/02 22:04:41 1.27.2.5 +++ gtkmenushell.c 2001/01/09 00:33:19 @@ -664,6 +664,11 @@ gtk_menu_shell_remove (GtkContainer *con was_visible = GTK_WIDGET_VISIBLE (widget); menu_shell = GTK_MENU_SHELL (container); menu_shell->children = g_list_remove (menu_shell->children, widget); + + if (widget == menu_shell->active_menu_item) + { + menu_shell->active_menu_item = NULL; + } gtk_widget_unparent (widget);
Attachment:
patch.diff
Description: Binary data