From f472b6deb142845923f3cf11d05ef141df604f73 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Tue, 19 Nov 2013 16:51:33 -0500 Subject: [PATCH] Pcbnew: fix assertion when deleting BOARD_ITEM not linked to list. (fixes lp:1252696) --- include/class_board_item.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/class_board_item.h b/include/class_board_item.h index 11676e418d..183aad9bb3 100644 --- a/include/class_board_item.h +++ b/include/class_board_item.h @@ -172,11 +172,13 @@ public: /** * 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() { - UnLink(); + if( GetList() != NULL ) + UnLink(); + delete this; }