From 09fbcf2a62dcbafaf5b7fc9af39c560480833733 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 8 Dec 2011 00:07:12 +0000 Subject: [PATCH] Fix asserts when removing the menu item starting radio group in wxOSX. Update m_startRadioGroup when removing the item it corresponds to. Closes #13545. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69952 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/menu_osx.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/osx/menu_osx.cpp b/src/osx/menu_osx.cpp index 964915949f..ee18135ab7 100644 --- a/src/osx/menu_osx.cpp +++ b/src/osx/menu_osx.cpp @@ -210,6 +210,17 @@ wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item) wxMenuItem *wxMenu::DoRemove(wxMenuItem *item) { + if ( m_startRadioGroup != -1 ) + { + // Check if we're removing the item starting the radio group + if ( GetMenuItems().Item(m_startRadioGroup)->GetData() == item ) + { + // Yes, we do, so reset its index as the next item added shouldn't + // count as part of the same radio group anyhow. + m_startRadioGroup = -1; + } + } + /* // we need to find the items position in the child list size_t pos; -- 2.45.2