From aa54a3e5a1b804af6c6697e1af18004eef95d94c Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 5 Mar 2014 16:44:08 +0100 Subject: [PATCH] Fixed undo while PNS is active. --- pcbnew/router/pns_router.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pcbnew/router/pns_router.cpp b/pcbnew/router/pns_router.cpp index 646d011404..e3cf287596 100644 --- a/pcbnew/router/pns_router.cpp +++ b/pcbnew/router/pns_router.cpp @@ -324,6 +324,9 @@ PNS_ROUTER::~PNS_ROUTER() { ClearWorld(); theRouter = NULL; + + if( m_previewItems ) + delete m_previewItems; } @@ -338,13 +341,9 @@ void PNS_ROUTER::ClearWorld() if( m_placer ) delete m_placer; - if( m_previewItems ) - delete m_previewItems; - m_clearanceFunc = NULL; m_world = NULL; m_placer = NULL; - m_previewItems = NULL; } @@ -468,9 +467,10 @@ void PNS_ROUTER::EraseView() } if( m_previewItems ) + { m_previewItems->FreeItems(); - - m_previewItems->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); + m_previewItems->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY ); + } }