Eeschema: Fix crash of modifying graphic item and abort with ESC by adding re-entrancy guards

This commit is contained in:
Zhuang Jiezhi 2023-10-27 21:19:31 +00:00 committed by Wayne Stambaugh
parent 6269453416
commit 61d03b41ec
2 changed files with 10 additions and 1 deletions

View File

@ -344,7 +344,8 @@ private:
EE_POINT_EDITOR::EE_POINT_EDITOR() :
EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.PointEditor" ),
m_editedPoint( nullptr )
m_editedPoint( nullptr ),
m_inPointEditor( false )
{
}
@ -411,6 +412,11 @@ int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
if( !m_selectionTool )
return 0;
if( m_inPointEditor )
return 0;
REENTRANCY_GUARD guard( &m_inPointEditor );
if( m_isSymbolEditor )
{
SYMBOL_EDIT_FRAME* editor = getEditFrame<SYMBOL_EDIT_FRAME>();

View File

@ -105,6 +105,9 @@ private:
///< Currently edited point, NULL if there is none.
EDIT_POINT* m_editedPoint;
///< Re-entrancy guards
bool m_inPointEditor;
///< Currently available edit points.
std::shared_ptr<EDIT_POINTS> m_editPoints;
};