From fda403a0791e0ec79692d6d7208a16448d465c80 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 20 Oct 2019 17:03:38 +0200 Subject: [PATCH] Fix potential issue --- pcbnew/board_connected_item.cpp | 2 +- pcbnew/class_zone.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pcbnew/board_connected_item.cpp b/pcbnew/board_connected_item.cpp index 32637cb675..b63f5a863a 100644 --- a/pcbnew/board_connected_item.cpp +++ b/pcbnew/board_connected_item.cpp @@ -66,7 +66,7 @@ bool BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode, bool aNoAssert ) m_netinfo = &NETINFO_LIST::ORPHANED_ITEM; if( !aNoAssert ) - assert( m_netinfo ); + wxASSERT( m_netinfo ); // Add only if it was previously added to the ratsnest //if( addRatsnest ) diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index 90037612a4..df0206319d 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -74,8 +74,11 @@ ZONE_CONTAINER::ZONE_CONTAINER( BOARD* aBoard ) : ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) : BOARD_CONNECTED_ITEM( aZone ) { - // Should the copy be on the same net? + m_isKeepout = aZone.m_isKeepout; + SetLayerSet( aZone.GetLayerSet() ); + SetNetCode( aZone.GetNetCode() ); + m_Poly = new SHAPE_POLY_SET( *aZone.m_Poly ); // For corner moving, corner index to drag, or nullptr if no selection @@ -93,7 +96,6 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) : m_FilledPolysList.Append( aZone.m_FilledPolysList ); m_FillSegmList = aZone.m_FillSegmList; // vector <> copy - m_isKeepout = aZone.m_isKeepout; m_doNotAllowCopperPour = aZone.m_doNotAllowCopperPour; m_doNotAllowVias = aZone.m_doNotAllowVias; m_doNotAllowTracks = aZone.m_doNotAllowTracks; @@ -105,7 +107,6 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) : m_hatchPitch = aZone.m_hatchPitch; m_HatchLines = aZone.m_HatchLines; - SetLayerSet( aZone.GetLayerSet() ); SetLocalFlags( aZone.GetLocalFlags() ); }