Invalid iterator safety.

This commit is contained in:
Jeff Young 2025-06-02 14:40:48 +01:00
parent 0ddb34e8b0
commit aa77f74c76
2 changed files with 8 additions and 3 deletions

View File

@ -752,6 +752,8 @@ bool SGSHAPE::Prepare( const glm::dmat4* aTransform, S3D::MATLIST& materials,
for( unsigned int i = 0; i < nvidx; ++i ) for( unsigned int i = 0; i < nvidx; ++i )
{ {
mit = indexmap.find( lv[i] ); mit = indexmap.find( lv[i] );
if( mit != indexmap.end() )
lvidx[i] = mit->second; lvidx[i] = mit->second;
} }

View File

@ -797,10 +797,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
{ {
auto mut_it = layer_lock.find( layer ); auto mut_it = layer_lock.find( layer );
if( mut_it != layer_lock.end() )
{
std::lock_guard< std::mutex > lock( *( mut_it->second ) ); std::lock_guard< std::mutex > lock( *( mut_it->second ) );
zone->TransformSolidAreasShapesToPolygon( layer, *m_layers_poly[layer] ); zone->TransformSolidAreasShapesToPolygon( layer, *m_layers_poly[layer] );
} }
} }
}
threadsFinished++; threadsFinished++;
} ); } );