From 98237e96a4fcfd8d869e454f868e168cf42c5e52 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 8 Aug 2020 15:14:41 +0100 Subject: [PATCH] Fix doubly-inited list. Fixes https://gitlab.com/kicad/code/kicad/issues/4921 --- common/project/net_settings.cpp | 2 +- include/netclass.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/project/net_settings.cpp b/common/project/net_settings.cpp index 8ac7f2c78c..9d52bf9d88 100644 --- a/common/project/net_settings.cpp +++ b/common/project/net_settings.cpp @@ -447,7 +447,7 @@ bool NET_SETTINGS::ParseBusGroup( wxString aGroup, wxString* aName, void NET_SETTINGS::ResolveNetClassAssignments( bool aRebuildFromScratch ) { - std::map baseList = m_NetClassAssignments; + std::map baseList; if( aRebuildFromScratch ) { diff --git a/include/netclass.h b/include/netclass.h index e56364acfb..9208950671 100644 --- a/include/netclass.h +++ b/include/netclass.h @@ -231,11 +231,13 @@ public: /** * Function Clear - * destroys any contained NETCLASS instances except the Default one. + * destroys any contained NETCLASS instances except the Default one, and clears any + * members from the Default one. */ void Clear() { m_NetClasses.clear(); + m_default->Clear(); } typedef NETCLASS_MAP::iterator iterator;