don't keep dangling m_prevRadio pointer (2nd part of patch 1836644)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
088dd4c9c9
commit
8d7490018a
@ -1245,11 +1245,19 @@ wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item)
|
|||||||
wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
|
wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
|
||||||
{
|
{
|
||||||
if ( !wxMenuBase::DoRemove(item) )
|
if ( !wxMenuBase::DoRemove(item) )
|
||||||
return (wxMenuItem *)NULL;
|
return NULL;
|
||||||
|
|
||||||
|
GtkWidget * const mitem = item->GetMenuItem();
|
||||||
|
if ( m_prevRadio == mitem )
|
||||||
|
{
|
||||||
|
// deleting an item starts a new radio group (has to as we shouldn't
|
||||||
|
// keep a deleted pointer anyhow)
|
||||||
|
m_prevRadio = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: this code doesn't delete the item factory item and this seems
|
// TODO: this code doesn't delete the item factory item and this seems
|
||||||
// impossible as of GTK 1.2.6.
|
// impossible as of GTK 1.2.6.
|
||||||
gtk_widget_destroy( item->GetMenuItem() );
|
gtk_widget_destroy( mitem );
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user