Avoid use after free in qa_eeschema due to pointer reuse

This commit is contained in:
Marek Roszko 2022-08-08 22:23:22 -04:00
parent b3fd9be52e
commit e1dcf4f3e2
1 changed files with 2 additions and 1 deletions

View File

@ -71,11 +71,12 @@ void KI_TEST::SCHEMATIC_TEST_FIXTURE::LoadSchematic( const wxString& aBaseName )
wxFileName pro( fn );
pro.SetExt( ProjectFileExtension );
// Schematic must be reset before a project is reloaded
m_schematic.Reset();
m_manager.LoadProject( pro.GetFullPath() );
m_manager.Prj().SetElem( PROJECT::ELEM_SCH_SYMBOL_LIBS, nullptr );
m_schematic.Reset();
m_schematic.SetProject( &m_manager.Prj() );
m_schematic.SetRoot( m_pi->Load( fn.GetFullPath(), &m_schematic ) );