From 65821328d22aac432817d17bae29ce8081a395d2 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 21 Sep 2016 14:47:07 +0200 Subject: [PATCH] Fix a crash when dragging a via attached to a locked track (PNS) Fixes: lp:1625835 * https://bugs.launchpad.net/kicad/+bug/1625835 --- pcbnew/router/pns_shove.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp index 97dbcfc8e2..5af8bc70c6 100644 --- a/pcbnew/router/pns_shove.cpp +++ b/pcbnew/router/pns_shove.cpp @@ -622,12 +622,6 @@ SHOVE::SHOVE_STATUS SHOVE::pushVia( VIA* aVia, const VECTOR2I& aForce, int aCurr pushedVia->SetPos( p0_pushed ); pushedVia->Mark( aVia->Marker() ); - if( aVia->Marker() & MK_HEAD ) - { - m_draggedVia = pushedVia.get(); - m_draggedViaHeadSet.Clear(); - } - for( ITEM* item : jt->LinkList() ) { if( SEGMENT* seg = dyn_cast( item ) ) @@ -671,6 +665,12 @@ SHOVE::SHOVE_STATUS SHOVE::pushVia( VIA* aVia, const VECTOR2I& aForce, int aCurr m_logger.Log( pushedVia.get(), 1, "pushed-via" ); #endif + if( aVia->Marker() & MK_HEAD ) + { + m_draggedVia = pushedVia.get(); + m_draggedViaHeadSet.Clear(); + } + replaceItems( aVia, std::move( pushedVia ) ); for( LINE_PAIR lp : draggedLines )