Clear field listener when quitting

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18016
This commit is contained in:
Jon Evans 2024-05-16 20:49:27 -04:00
parent fd438cb8e0
commit 2836025402
2 changed files with 7 additions and 0 deletions

View File

@ -120,6 +120,8 @@ SCHEMATIC::SCHEMATIC( PROJECT* aPrj ) :
SCHEMATIC::~SCHEMATIC()
{
PROPERTY_MANAGER::Instance().UnregisterListeners( TYPE_HASH( SCH_FIELD ) );
delete m_currentSheet;
delete m_connectionGraph;
}

View File

@ -277,6 +277,11 @@ public:
m_listeners[aType].emplace_back( aListenerFunc );
}
void UnregisterListeners( TYPE_ID aType )
{
m_listeners[aType].clear();
}
private:
PROPERTY_MANAGER() :
m_dirty( false ),