use unique_ptr to document ownership (PNS::LINE_PLACER)

This commit is contained in:
decimad 2016-08-29 20:42:56 +02:00 committed by Maciej Suminski
parent 4770be0920
commit 2aef1a4568
2 changed files with 3 additions and 8 deletions

View File

@ -59,8 +59,6 @@ LINE_PLACER::LINE_PLACER( ROUTER* aRouter ) :
LINE_PLACER::~LINE_PLACER()
{
if( m_shove )
delete m_shove;
}
@ -796,14 +794,11 @@ void LINE_PLACER::initPlacement()
m_currentNode = m_world;
m_currentMode = Settings().Mode();
if( m_shove )
delete m_shove;
m_shove = NULL;
m_shove.reset();
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() ) );
}
}

View File

@ -368,7 +368,7 @@ private:
VECTOR2I m_p_start;
///> The shove engine
SHOVE* m_shove;
std::unique_ptr< SHOVE > m_shove;
///> Current world state
NODE* m_currentNode;