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:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user