use unique_ptr to document ownership (PNS::LINE_PLACER)
This commit is contained in:
parent
4770be0920
commit
2aef1a4568
|
@ -59,8 +59,6 @@ LINE_PLACER::LINE_PLACER( ROUTER* aRouter ) :
|
||||||
|
|
||||||
LINE_PLACER::~LINE_PLACER()
|
LINE_PLACER::~LINE_PLACER()
|
||||||
{
|
{
|
||||||
if( m_shove )
|
|
||||||
delete m_shove;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -796,14 +794,11 @@ void LINE_PLACER::initPlacement()
|
||||||
m_currentNode = m_world;
|
m_currentNode = m_world;
|
||||||
m_currentMode = Settings().Mode();
|
m_currentMode = Settings().Mode();
|
||||||
|
|
||||||
if( m_shove )
|
m_shove.reset();
|
||||||
delete m_shove;
|
|
||||||
|
|
||||||
m_shove = NULL;
|
|
||||||
|
|
||||||
if( m_currentMode == RM_Shove || m_currentMode == RM_Smart )
|
if( m_currentMode == RM_Shove || m_currentMode == RM_Smart )
|
||||||
{
|
{
|
||||||
m_shove = new SHOVE( m_world->Branch(), Router() );
|
m_shove.reset( new SHOVE( m_world->Branch(), Router() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -368,7 +368,7 @@ private:
|
||||||
VECTOR2I m_p_start;
|
VECTOR2I m_p_start;
|
||||||
|
|
||||||
///> The shove engine
|
///> The shove engine
|
||||||
SHOVE* m_shove;
|
std::unique_ptr< SHOVE > m_shove;
|
||||||
|
|
||||||
///> Current world state
|
///> Current world state
|
||||||
NODE* m_currentNode;
|
NODE* m_currentNode;
|
||||||
|
|
Loading…
Reference in New Issue