Pcbnew: fix assertion when deleting BOARD_ITEM not linked to list. (fixes lp:1252696)

This commit is contained in:
Wayne Stambaugh 2013-11-19 16:51:33 -05:00
parent abfeab02d7
commit f472b6deb1
1 changed files with 4 additions and 2 deletions

View File

@ -172,11 +172,13 @@ public:
/** /**
* Function DeleteStructure * Function DeleteStructure
* deletes this object after UnLink()ing it from its owner. * deletes this object after UnLink()ing it from its owner if it has one.
*/ */
void DeleteStructure() void DeleteStructure()
{ {
UnLink(); if( GetList() != NULL )
UnLink();
delete this; delete this;
} }