From 8e1bcaed3757f7cd5f9d6609e885933b2c73552d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 8 May 2023 11:35:41 +0100 Subject: [PATCH] Holes need a parent. SetHole() handles all this for us. Make sure it's called. Fixes https://gitlab.com/kicad/code/kicad/issues/14702 (cherry picked from commit 5b3798a3706340f39ce6cf1e223424a290c9151e) --- pcbnew/router/pns_solid.h | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pcbnew/router/pns_solid.h b/pcbnew/router/pns_solid.h index 56a6fa14af..43e1ad49a5 100644 --- a/pcbnew/router/pns_solid.h +++ b/pcbnew/router/pns_solid.h @@ -2,7 +2,7 @@ * KiRouter - a push-and-(sometimes-)shove PCB router * * Copyright (C) 2013 CERN - * Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors. * Author: Tomasz Wlostowski * * This program is free software: you can redistribute it and/or modify it @@ -36,9 +36,9 @@ class SOLID : public ITEM { public: SOLID() : - ITEM( SOLID_T ), - m_shape( nullptr ), - m_hole( nullptr ) + ITEM( SOLID_T ), + m_shape( nullptr ), + m_hole( nullptr ) { m_movable = false; m_padToDie = 0; @@ -46,24 +46,20 @@ public: ~SOLID() { - if ( m_hole ) - delete m_hole; - + delete m_hole; delete m_shape; } SOLID( const SOLID& aSolid ) : - ITEM( aSolid ) + ITEM( aSolid ), + m_shape( nullptr ), + m_hole( nullptr ) { if( aSolid.m_shape ) - m_shape = aSolid.m_shape->Clone(); - else - m_shape = nullptr; + SetShape( aSolid.m_shape->Clone() ); if( aSolid.m_hole ) - m_hole = aSolid.m_hole->Clone(); - else - m_hole = nullptr; + SetHole( aSolid.m_hole->Clone() ); m_pos = aSolid.m_pos; m_padToDie = aSolid.m_padToDie;