Fixed a memleak when no undo entry is requested in BOARD_COMMIT
This commit is contained in:
parent
93e7d52633
commit
05ab44f463
|
@ -264,9 +264,16 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry )
|
|||
module->RunOnChildren( [&view] ( BOARD_ITEM* aItem ) { view->Update( aItem ); } );
|
||||
}
|
||||
|
||||
view->Update ( boardItem );
|
||||
connectivity->MarkItemNetAsDirty( static_cast<BOARD_ITEM*>( ent.m_copy ) );
|
||||
if( ent.m_copy )
|
||||
connectivity->MarkItemNetAsDirty( static_cast<BOARD_ITEM*>( ent.m_copy ) );
|
||||
|
||||
connectivity->Update( boardItem );
|
||||
view->Update( boardItem );
|
||||
|
||||
// if no undo entry is needed, the copy would create a memory leak
|
||||
if( !aCreateUndoEntry )
|
||||
delete ent.m_copy;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue