Pcbnew: fix segfault after deleting a pad from a footprint then performing a DRC action such as a via drag.

This commit is contained in:
Dick Hollenbeck
2015-09-23 19:02:40 -04:00
committed by Wayne Stambaugh
parent 49cad0de95
commit b27176f230
7 changed files with 51 additions and 15 deletions
+7 -9
View File
@@ -537,29 +537,27 @@ void MoveMarkedItems( MODULE* module, wxPoint offset )
*/
void DeleteMarkedItems( MODULE* module )
{
BOARD_ITEM* item;
BOARD_ITEM* next_item;
D_PAD* pad;
D_PAD* next_pad;
BOARD* board = module->GetBoard();
if( module == NULL )
return;
pad = module->Pads();
for( ; pad != NULL; pad = next_pad )
for( D_PAD* pad = module->Pads(); pad; pad = next_pad )
{
next_pad = pad->Next();
if( !pad->IsSelected() )
continue;
pad->DeleteStructure();
if( board )
board->PadDelete( pad );
else
pad->DeleteStructure();
}
item = module->GraphicalItems();
for( ; item != NULL; item = next_item )
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = next_item )
{
next_item = item->Next();