Avoid TB_DELETEBUTTON errors when recreating wxMSW wxToolBar

Reset the number of buttons to skip deleting the old buttons in
wxToolBar::Recreate() as these buttons don't exist any more (having been
created in the old control) and trying to delete them just results in
debug error messages from TB_DELETEBUTTON.
This commit is contained in:
Vadim Zeitlin
2019-03-29 19:13:45 +01:00
parent 876d0f293f
commit 6b6fee8685

View File

@@ -519,6 +519,11 @@ void wxToolBar::Recreate()
wxDELETE(m_disabledImgList);
// Also skip deleting the existing buttons in Realize(): they don't exist
// any more, so doing this is unnecessary and just results in errors from
// TB_DELETEBUTTON.
m_nButtons = 0;
Realize();
}