Never call ReCreateMenuBar inside a menu event handler
As of wxWidgets 3.2, the wxWidgets event handler runs code after the the client event handler that depends on the menu still existing. Because there are potentially many paths to call ReCreateMenuBar from within a menu event handler, let's just wrap this action in a CallAfter to make sure it happens after the wx handler call completes. Fixes https://gitlab.com/kicad/code/kicad/-/issues/13149
This commit is contained in:
@@ -206,7 +206,7 @@ wxWindow* BM2CMP_FRAME::GetToolCanvas() const
|
||||
}
|
||||
|
||||
|
||||
void BM2CMP_FRAME::ReCreateMenuBar()
|
||||
void BM2CMP_FRAME::doReCreateMenuBar()
|
||||
{
|
||||
// wxWidgets handles the Mac Application menu behind the scenes, but that means
|
||||
// we always have to start from scratch with a new wxMenuBar.
|
||||
|
||||
Reference in New Issue
Block a user