use unique_ptr to document ownership (PNS::LINE_PLACER)

This commit is contained in:
decimad
2016-09-06 16:06:06 +02:00
committed by Maciej Suminski
parent 4770be0920
commit 2aef1a4568
2 changed files with 3 additions and 8 deletions
+2 -7
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() ) );
}
}
+1 -1
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;