Fix exception while reinserting menu item.

After removing an item from a menu that item's parent menu is set to NULL
and can't be used any longer to insert the item again. Fix by remembering
the parent menu before removing the item from it.

Regression since r76251 (this commit is a partial revert of that commit).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth
2014-06-23 20:00:42 +00:00
parent bab52682bc
commit 1c49a2e1ba
2 changed files with 11 additions and 2 deletions

View File

@@ -420,6 +420,12 @@ void MenuTestCase::ChangeBitmap()
// again etc...
item->SetBitmap( wxBitmap(1, 1) );
// Force owner drawn usage by having a bitmap that's wider than the
// standard size. This results in rearranging the parent menu which
// hasn't always worked properly and lead to a null pointer exception.
item->SetBitmap( wxBitmap(512, 1) );
wxDELETE(menu);
}