Browse Source

SCH_PIN: Guard the calculated map

Pins are used in threaded application so we need to keep the
precalculation map guarded
pull/13/head
Seth Hillbrand 7 years ago
parent
commit
1c93b122f1
  1. 2
      eeschema/sch_pin.cpp
  2. 4
      eeschema/sch_pin.h

2
eeschema/sch_pin.cpp

@ -67,6 +67,8 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH aPath )
if( m_pin->IsPowerConnection() )
return m_pin->GetName();
std::lock_guard<std::mutex> lock( m_netmap_mutex );
if( m_net_name_map.count( aPath ) > 0 )
return m_net_name_map.at( aPath );

4
eeschema/sch_pin.h

@ -26,6 +26,9 @@
#include <sch_sheet_path.h>
#include <lib_pin.h>
#include <mutex>
#include <map>
class SCH_COMPONENT;
class SCH_PIN : public SCH_ITEM
@ -37,6 +40,7 @@ class SCH_PIN : public SCH_ITEM
bool m_isDangling;
/// The name that this pin connection will drive onto a net
std::mutex m_netmap_mutex;
std::map<const SCH_SHEET_PATH, wxString> m_net_name_map;
public:

Loading…
Cancel
Save