Don't access tools after they've shut down.

This commit is contained in:
Jeff Young 2020-12-29 17:29:24 +00:00
parent 35a5781f68
commit 07673d3c11
1 changed files with 5 additions and 0 deletions

View File

@ -308,13 +308,18 @@ SCH_EDIT_FRAME::~SCH_EDIT_FRAME()
{
// Shutdown all running tools
if( m_toolManager )
{
m_toolManager->ShutdownAllTools();
delete m_toolManager;
m_toolManager = nullptr;
}
delete m_item_to_repeat; // we own the cloned object, see this->SaveCopyForRepeatItem()
SetScreen( NULL );
delete m_schematic;
m_schematic = nullptr;
// Close the project if we are standalone, so it gets cleaned up properly
if( Kiface().IsSingle() )