diff --git a/include/ttl/halfedge/hetriang.h b/include/ttl/halfedge/hetriang.h index 59cfdaccb9..1642e92ce8 100644 --- a/include/ttl/halfedge/hetriang.h +++ b/include/ttl/halfedge/hetriang.h @@ -106,9 +106,6 @@ protected: /// Tag for quick connection resolution int m_tag; - /// Reference count - unsigned int m_refCount; - /// List of board items that share this node std::list m_parents; @@ -127,7 +124,7 @@ public: #ifdef TTL_USE_NODE_ID m_id( id_count++ ), #endif - m_x( aX ), m_y( aY ), m_tag( -1 ), m_refCount( 0 ) + m_x( aX ), m_y( aY ), m_tag( -1 ) { m_layers.reset(); } @@ -181,19 +178,9 @@ public: } #endif - inline void IncRefCount() - { - m_refCount++; - } - - inline void DecRefCount() - { - m_refCount--; - } - inline unsigned int GetRefCount() const { - return m_refCount; + return m_parents.size(); } inline void AddParent( const BOARD_CONNECTED_ITEM* aParent ) diff --git a/pcbnew/ratsnest_data.cpp b/pcbnew/ratsnest_data.cpp index 8de9fcbb15..e7ad2d8314 100644 --- a/pcbnew/ratsnest_data.cpp +++ b/pcbnew/ratsnest_data.cpp @@ -255,7 +255,6 @@ const RN_NODE_PTR& RN_LINKS::AddNode( int aX, int aY ) bool wasNewElement; boost::tie( node, wasNewElement ) = m_nodes.emplace( boost::make_shared( aX, aY ) ); - (*node)->IncRefCount(); // TODO use the shared_ptr use_count return *node; } @@ -263,8 +262,6 @@ const RN_NODE_PTR& RN_LINKS::AddNode( int aX, int aY ) bool RN_LINKS::RemoveNode( const RN_NODE_PTR& aNode ) { - aNode->DecRefCount(); // TODO use the shared_ptr use_count - if( aNode->GetRefCount() == 0 ) { m_nodes.erase( aNode );