Fix menu item destruction broken by r75250.
The menu items were not removed from the menu any longer when they were deleted or destroyed after the changes in this revision. Fix this by calling the public Remove(), which does the right thing, instead of the private DoRemove(), which only does part of the job of removing the item, in DoDelete() and DoDestroy(). See #3424. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75290 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -458,7 +458,7 @@ bool wxMenuBase::Delete(wxMenuItem *item)
|
||||
|
||||
bool wxMenuBase::DoDelete(wxMenuItem *item)
|
||||
{
|
||||
wxMenuItem *item2 = DoRemove(item);
|
||||
wxMenuItem *item2 = Remove(item);
|
||||
wxCHECK_MSG( item2, false, wxT("failed to delete menu item") );
|
||||
|
||||
// don't delete the submenu
|
||||
@@ -478,7 +478,7 @@ bool wxMenuBase::Destroy(wxMenuItem *item)
|
||||
|
||||
bool wxMenuBase::DoDestroy(wxMenuItem *item)
|
||||
{
|
||||
wxMenuItem *item2 = DoRemove(item);
|
||||
wxMenuItem *item2 = Remove(item);
|
||||
wxCHECK_MSG( item2, false, wxT("failed to delete menu item") );
|
||||
|
||||
delete item2;
|
||||
|
Reference in New Issue
Block a user