Browse Source

Don't segfault after doing a cutout which removes entire zone.

Fixes https://gitlab.com/kicad/code/kicad/issues/5532
6.0.7
Jeff Young 5 years ago
parent
commit
ea387f2f28
  1. 12
      pcbnew/tools/zone_create_helper.cpp

12
pcbnew/tools/zone_create_helper.cpp

@ -168,6 +168,7 @@ void ZONE_CREATE_HELPER::performZoneCutout( ZONE_CONTAINER& aZone, ZONE_CONTAINE
commit.Remove( &aZone );
ZONE_FILLER filler( board, &commit );
if( !filler.Fill( newZones ) )
{
commit.Revert();
@ -177,8 +178,15 @@ void ZONE_CREATE_HELPER::performZoneCutout( ZONE_CONTAINER& aZone, ZONE_CONTAINE
commit.Push( _( "Add a zone cutout" ) );
// Select the new zone and set it as the source for the next cutout
toolMgr->RunAction( PCB_ACTIONS::selectItem, true, newZones[0] );
m_params.m_sourceZone = newZones[0];
if( newZones.empty() )
{
m_params.m_sourceZone = nullptr;
}
else
{
m_params.m_sourceZone = newZones[0];
toolMgr->RunAction( PCB_ACTIONS::selectItem, true, newZones[0] );
}
}

Loading…
Cancel
Save