pns: fixed a few memleaks & conditional jumps depending on uninitalized variables
This commit is contained in:
parent
7909de6127
commit
9f0b42cb35
|
@ -466,8 +466,9 @@ bool SHAPE::Collide( const SHAPE* aShape, int aClerance ) const
|
|||
return CollideShapes( this, aShape, aClerance, false, dummy );
|
||||
}
|
||||
|
||||
|
||||
bool SHAPE_RECT::Collide( const SEG& aSeg, int aClearance ) const
|
||||
{
|
||||
{
|
||||
//VECTOR2I pmin = VECTOR2I( std::min( aSeg.a.x, aSeg.b.x ), std::min( aSeg.a.y, aSeg.b.y ) );
|
||||
//VECTOR2I pmax = VECTOR2I( std::max( aSeg.a.x, aSeg.b.x ), std::max( aSeg.a.y, aSeg.b.y ));
|
||||
//BOX2I r( pmin, VECTOR2I( pmax.x - pmin.x, pmax.y - pmin.y ) );
|
||||
|
@ -493,4 +494,4 @@ bool SHAPE_RECT::Collide( const SEG& aSeg, int aClearance ) const
|
|||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -295,6 +295,7 @@ public:
|
|||
~PNS_PCBNEW_DEBUG_DECORATOR()
|
||||
{
|
||||
Clear();
|
||||
delete m_items;
|
||||
}
|
||||
|
||||
void SetView( KIGFX::VIEW* aView )
|
||||
|
@ -416,11 +417,14 @@ PNS_KICAD_IFACE::PNS_KICAD_IFACE()
|
|||
|
||||
PNS_KICAD_IFACE::~PNS_KICAD_IFACE()
|
||||
{
|
||||
if( m_ruleResolver )
|
||||
delete m_ruleResolver;
|
||||
|
||||
if( m_debugDecorator )
|
||||
delete m_debugDecorator;
|
||||
|
||||
if( m_previewItems )
|
||||
{
|
||||
m_previewItems->FreeItems();
|
||||
delete m_previewItems;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -741,9 +745,7 @@ void PNS_KICAD_IFACE::SyncWorld( PNS_NODE *aWorld )
|
|||
|
||||
int worstClearance = m_board->GetDesignSettings().GetBiggestClearanceValue();
|
||||
|
||||
if( m_ruleResolver )
|
||||
delete m_ruleResolver;
|
||||
|
||||
m_ruleResolver = new PNS_PCBNEW_RULE_RESOLVER( m_board, m_router );
|
||||
|
||||
aWorld->SetRuleResolver( m_ruleResolver );
|
||||
|
@ -892,9 +894,7 @@ void PNS_KICAD_IFACE::SetView( KIGFX::VIEW *aView )
|
|||
m_view->Add( m_previewItems );
|
||||
m_previewItems->ViewSetVisible( true );
|
||||
|
||||
if( m_debugDecorator )
|
||||
delete m_debugDecorator;
|
||||
|
||||
m_debugDecorator = new PNS_PCBNEW_DEBUG_DECORATOR();
|
||||
m_debugDecorator->SetView( m_view );
|
||||
}
|
||||
|
|
|
@ -205,6 +205,7 @@ struct PNS_NODE::DEFAULT_OBSTACLE_VISITOR : public PNS_OBSTACLE_VISITOR
|
|||
m_kindMask( aKindMask ),
|
||||
m_limitCount( -1 ),
|
||||
m_matchCount( 0 ),
|
||||
m_extraClearance( 0 ),
|
||||
m_differentNetsOnly( aDifferentNetsOnly ),
|
||||
m_forceClearance( -1 )
|
||||
{
|
||||
|
|
|
@ -68,7 +68,10 @@ TOOL_ACTION PNS_TOOL_BASE::ACT_RouterOptions( "pcbnew.InteractiveRouter.RouterOp
|
|||
PNS_TOOL_BASE::PNS_TOOL_BASE( const std::string& aToolName ) :
|
||||
TOOL_INTERACTIVE( aToolName )
|
||||
{
|
||||
m_gridHelper = NULL;
|
||||
m_iface = NULL;
|
||||
m_router = NULL;
|
||||
|
||||
m_startItem = NULL;
|
||||
m_startLayer = 0;
|
||||
|
||||
|
@ -83,20 +86,18 @@ PNS_TOOL_BASE::PNS_TOOL_BASE( const std::string& aToolName ) :
|
|||
|
||||
PNS_TOOL_BASE::~PNS_TOOL_BASE()
|
||||
{
|
||||
delete m_router;
|
||||
delete m_gridHelper;
|
||||
delete m_iface;
|
||||
delete m_router;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void PNS_TOOL_BASE::Reset( RESET_REASON aReason )
|
||||
{
|
||||
if( m_router )
|
||||
delete m_router;
|
||||
|
||||
if( m_gridHelper)
|
||||
delete m_gridHelper;
|
||||
|
||||
delete m_iface;
|
||||
delete m_router;
|
||||
|
||||
m_frame = getEditFrame<PCB_EDIT_FRAME>();
|
||||
m_ctls = getViewControls();
|
||||
|
|
Loading…
Reference in New Issue