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:
Jon Evans
2022-12-16 16:37:51 -05:00
parent 0e2a4e3f15
commit 5abf73e3c9
27 changed files with 54 additions and 32 deletions
+1 -1
View File
@@ -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.