Re-entrancy guard for router tool.

Fixes https://gitlab.com/kicad/code/kicad/issues/12604

(cherry picked from commit 413fd82813)
This commit is contained in:
Jeff Young 2022-10-17 13:20:40 +01:00
parent e8d2c222b6
commit bf95906f90
2 changed files with 9 additions and 1 deletions

View File

@ -171,7 +171,8 @@ static const TOOL_ACTION ACT_SwitchCornerMode( "pcbnew.InteractiveRouter.SwitchR
ROUTER_TOOL::ROUTER_TOOL() :
TOOL_BASE( "pcbnew.InteractiveRouter" ),
m_lastTargetLayer( UNDEFINED_LAYER )
m_lastTargetLayer( UNDEFINED_LAYER ),
m_inRouterTool( false )
{
}
@ -1394,6 +1395,11 @@ void ROUTER_TOOL::breakTrack()
int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
{
if( m_inRouterTool )
return 0;
REENTRANCY_GUARD guard( &m_inRouterTool );
PNS::ROUTER_MODE mode = aEvent.Parameter<PNS::ROUTER_MODE>();
PCB_EDIT_FRAME* frame = getEditFrame<PCB_EDIT_FRAME>();
VIEW_CONTROLS* controls = getViewControls();

View File

@ -89,6 +89,8 @@ private:
std::shared_ptr<ACTION_MENU> m_trackViaMenu;
int m_lastTargetLayer;
bool m_inRouterTool; // Re-entrancy guard
};
#endif