From 10c6e0bc46aa4cf702e4584ae6e346bf854b4b0b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 21 Jan 2021 22:05:08 +0000 Subject: [PATCH] Cache entries are dependant on setting of aForceNoConnect Don't use a result cached when aForceNoConnect was false when aForceNoConnect is true. --- eeschema/sch_pin.cpp | 11 ++++++++--- eeschema/sch_pin.h | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/eeschema/sch_pin.cpp b/eeschema/sch_pin.cpp index 2db7578bd8..bc227d6c17 100644 --- a/eeschema/sch_pin.cpp +++ b/eeschema/sch_pin.cpp @@ -238,8 +238,13 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoC std::lock_guard lock( m_netmap_mutex ); - if( m_net_name_map.count( aPath ) > 0 ) - return m_net_name_map.at( aPath ); + auto it = m_net_name_map.find( aPath ); + + if( it != m_net_name_map.end() ) + { + if( it->second.second == aForceNoConnect ) + return it->second.first; + } wxString name = "Net-("; @@ -260,7 +265,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoC name << "-Pad" << m_libPin->GetNumber() << ")"; if( annotated ) - m_net_name_map[ aPath ] = name; + m_net_name_map[ aPath ] = std::make_pair( name, aForceNoConnect ); return name; } diff --git a/eeschema/sch_pin.h b/eeschema/sch_pin.h index 62d9b86b0f..117ca8850c 100644 --- a/eeschema/sch_pin.h +++ b/eeschema/sch_pin.h @@ -42,8 +42,8 @@ class SCH_PIN : public SCH_ITEM bool m_isDangling; /// The name that this pin connection will drive onto a net - std::recursive_mutex m_netmap_mutex; - std::map m_net_name_map; + std::recursive_mutex m_netmap_mutex; + std::map> m_net_name_map; public: SCH_PIN( LIB_PIN* aLibPin, SCH_COMPONENT* aParentSymbol );