Clear field listener when quitting

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18016


(cherry picked from commit 2836025402)

Co-authored-by: Jon Evans <jon@craftyjon.com>
This commit is contained in:
Jon Evans 2024-05-17 00:50:48 +00:00
parent e66d25b6e8
commit 1defa3872e
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 ),