Check recursion before appending
We need to ensure that the appended sheet does not already exist in the
parent hierarchy. We do this for new sheets but need to check for
existing ones as well.
Fixes #3806 | https://gitlab.com/kicad/code/kicad/issues/3806
(cherry picked from commit 7ac83ac64d
)
This commit is contained in:
parent
1cbee4c504
commit
dc3c6b2f39
|
@ -737,7 +737,8 @@ bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHierarchy,
|
|||
aHierarchy->LastScreen()->Remove( aSheet );
|
||||
}
|
||||
|
||||
if( !LoadSheetFromFile( aSheet, aHierarchy, newFilename ) )
|
||||
if( !LoadSheetFromFile( aSheet, aHierarchy, newFilename )
|
||||
|| checkSheetForRecursion( aSheet, aHierarchy ) )
|
||||
{
|
||||
if( restoreSheet )
|
||||
aHierarchy->LastScreen()->Append( aSheet );
|
||||
|
|
Loading…
Reference in New Issue