Fix initialization of schematic in legacy plugin

This commit is contained in:
Jon Evans 2020-05-19 09:08:49 -04:00
parent 4efed4b729
commit 14773d073d
1 changed files with 2 additions and 2 deletions

View File

@ -596,8 +596,6 @@ SCH_SHEET* SCH_LEGACY_PLUGIN::Load( const wxString& aFileName, KIWAY* aKiway, SC
LOCALE_IO toggle; // toggles on, then off, the C locale.
SCH_SHEET* sheet;
m_schematic = aSchematic;
wxFileName fn = aFileName;
// Unfortunately child sheet file names the legacy schematic file format are not fully
@ -631,6 +629,8 @@ SCH_SHEET* SCH_LEGACY_PLUGIN::Load( const wxString& aFileName, KIWAY* aKiway, SC
m_currentPath.push( m_path );
init( aKiway, aProperties );
m_schematic = aSchematic;
if( aAppendToMe == NULL )
{
// Clean up any allocated memory if an exception occurs loading the schematic.