Don't capture references to local variables for CallAfter.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16934

(cherry picked from commit 9d40374baf)
This commit is contained in:
Jeff Young
2024-02-23 16:53:30 +01:00
committed by Roberto Fernandez Bautista
parent 276171b85e
commit 9ff66d0e71
14 changed files with 27 additions and 19 deletions
+4 -1
View File
@@ -90,7 +90,10 @@ KIPYTHON_FRAME::KIPYTHON_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
wxDefaultSize, KICAD_DEFAULT_DRAWFRAME_STYLE, wxT( "KiPython" ),
unityScale )
{
CallAfter( [&](){ SetupPythonEditor(); } );
CallAfter( [this]()
{
SetupPythonEditor();
} );
redirectStdio();
}