diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 8ae6d6f089..3066b81571 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -370,9 +370,11 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) } else if ( m_radioData ) { - bool groupWasSplit = m_radioData->UpdateOnInsertNonRadio(pos); - wxASSERT_MSG( !groupWasSplit, - wxS("Inserting non-radio item inside a radio group?") ); + if ( m_radioData->UpdateOnInsertNonRadio(pos) ) + { + // One of the exisiting groups has been split into two subgroups. + wxFAIL_MSG(wxS("Inserting non-radio item inside a radio group?")); + } } // Also handle the case of check menu items that had been checked before diff --git a/src/osx/menu_osx.cpp b/src/osx/menu_osx.cpp index 86f9d6c299..0351c2dce6 100644 --- a/src/osx/menu_osx.cpp +++ b/src/osx/menu_osx.cpp @@ -149,9 +149,11 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *item, size_t pos) } else if ( m_radioData ) { - bool groupWasSplit = m_radioData->UpdateOnInsertNonRadio(pos); - wxASSERT_MSG( !groupWasSplit, - wxS("Inserting non-radio item inside a radio group?") ); + if ( m_radioData->UpdateOnInsertNonRadio(pos) ) + { + // One of the exisiting groups has been split into two subgroups. + wxFAIL_MSG(wxS("Inserting non-radio item inside a radio group?")); + } } // if we're already attached to the menubar, we must update it