mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Lock safety.
We're going to grab the lock every time through anyway, might as well have it for the reads as well as the writes.
This commit is contained in:
parent
a7a83efc46
commit
95ab9f0b50
@ -625,8 +625,9 @@ void TRACKS_CLEANER::cleanup( bool aDeleteDuplicateVias, bool aDeleteNullSegment
|
||||
const std::vector<BOARD_CONNECTED_ITEM*>& TRACKS_CLEANER::getConnectedItems( PCB_TRACK* aTrack )
|
||||
{
|
||||
const std::shared_ptr<CONNECTIVITY_DATA>& connectivity = m_brd->GetConnectivity();
|
||||
std::lock_guard lock( m_mutex );
|
||||
|
||||
if( std::lock_guard lock( m_mutex ); !m_connectedItemsCache.contains( aTrack ) )
|
||||
if( !m_connectedItemsCache.contains( aTrack ) )
|
||||
m_connectedItemsCache[aTrack] = connectivity->GetConnectedItems( aTrack );
|
||||
|
||||
return m_connectedItemsCache.at( aTrack );
|
||||
|
Loading…
x
Reference in New Issue
Block a user