Pcbnew: fix crash when trying to delete a PCB_TEXT.
This commit is contained in:
parent
31354a2d91
commit
054de5687c
|
@ -1798,15 +1798,25 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut )
|
|||
{
|
||||
case PCB_TEXT::TEXT_is_VALUE:
|
||||
case PCB_TEXT::TEXT_is_REFERENCE:
|
||||
wxASSERT( parentFP );
|
||||
m_commit->Modify( parentFP );
|
||||
static_cast<PCB_TEXT*>( board_item )->SetVisible( false );
|
||||
getView()->Update( board_item );
|
||||
break;
|
||||
|
||||
case PCB_TEXT::TEXT_is_DIVERS:
|
||||
if( IsFootprintEditor() )
|
||||
{
|
||||
m_commit->Modify( parentFP );
|
||||
getView()->Remove( board_item );
|
||||
parentFP->Remove( board_item );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_commit->Remove( board_item );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL; // Shouldn't get here
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue