diff --git a/pcbnew/connectivity_algo.cpp b/pcbnew/connectivity_algo.cpp index 6562a3f2e9..bacdc40ef9 100644 --- a/pcbnew/connectivity_algo.cpp +++ b/pcbnew/connectivity_algo.cpp @@ -932,8 +932,18 @@ void CN_CONNECTIVITY_ALGO::MarkNetAsDirty( int aNet ) return; if( (int) m_dirtyNets.size() <= aNet ) + { + int lastNet = m_dirtyNets.size() - 1; + + if( lastNet < 0 ) + lastNet = 0; + m_dirtyNets.resize( aNet + 1 ); + for( int i = lastNet; i < aNet + 1; i++ ) + m_dirtyNets[i] = true; + } + m_dirtyNets[aNet] = true; }