router: Do not use reference to a temporary object. Prevent double freeing (m_joints). Draw tuned track always on top.

This commit is contained in:
Tomasz Wlostowski 2015-08-12 21:12:13 +02:00 committed by Maciej Suminski
parent 6989af7904
commit e342744a32
3 changed files with 4 additions and 3 deletions

View File

@ -181,7 +181,7 @@ public:
return m_linkedItems; return m_linkedItems;
} }
PNS_ITEMSET Links() const PNS_ITEMSET& Links()
{ {
return m_linkedItems; return m_linkedItems;
} }

View File

@ -82,13 +82,14 @@ PNS_NODE::~PNS_NODE()
allocNodes.erase( this ); allocNodes.erase( this );
#endif #endif
m_joints.clear();
for( PNS_INDEX::ITEM_SET::iterator i = m_index->begin(); i != m_index->end(); ++i ) for( PNS_INDEX::ITEM_SET::iterator i = m_index->begin(); i != m_index->end(); ++i )
{ {
if( (*i)->BelongsTo( this ) ) if( (*i)->BelongsTo( this ) )
delete *i; delete *i;
} }
releaseGarbage(); releaseGarbage();
unlinkParent(); unlinkParent();

View File

@ -274,7 +274,7 @@ void ROUTER_PREVIEW_ITEM::Line( const SHAPE_LINE_CHAIN& aLine, int aWidth, int a
m_width = aWidth; m_width = aWidth;
m_color = assignColor( aStyle ); m_color = assignColor( aStyle );
m_type = PR_SHAPE; m_type = PR_SHAPE;
m_depth = -BaseOverlayDepth; m_depth = -1024; // TODO gal->GetMinDepth()
m_shape = aLine.Clone(); m_shape = aLine.Clone();
ViewSetVisible( true ); ViewSetVisible( true );