mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-11 16:10:10 +00:00
Fix potential data race (from Coverity warning 533646)
This commit is contained in:
parent
79a7849894
commit
b7b28e555e
@ -632,11 +632,8 @@ const std::vector<BOARD_CONNECTED_ITEM*>& TRACKS_CLEANER::getConnectedItems( PCB
|
||||
|
||||
const std::shared_ptr<CONNECTIVITY_DATA>& connectivity = m_brd->GetConnectivity();
|
||||
|
||||
if( !m_connectedItemsCache.contains( aTrack ) )
|
||||
{
|
||||
std::lock_guard lock( m_mutex );
|
||||
m_connectedItemsCache[ aTrack ] = connectivity->GetConnectedItems( aTrack, connectedTypes );
|
||||
}
|
||||
if( std::lock_guard lock( m_mutex ); !m_connectedItemsCache.contains( aTrack ) )
|
||||
m_connectedItemsCache[aTrack] = connectivity->GetConnectedItems( aTrack, connectedTypes );
|
||||
|
||||
return m_connectedItemsCache.at( aTrack );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user