diff --git a/pcbnew/router/pns_link_holder.h b/pcbnew/router/pns_link_holder.h index 89bbf1a490..5c021479b1 100644 --- a/pcbnew/router/pns_link_holder.h +++ b/pcbnew/router/pns_link_holder.h @@ -39,18 +39,15 @@ public: ///< Add a reference to an item registered in a #NODE that is a part of this line. void Link( LINKED_ITEM* aLink ) { -#ifdef DEBUG - assert ( !alg::contains( m_links, aLink ) ); -#endif + wxCHECK_MSG( !alg::contains( m_links, aLink ), /* void */, + "Trying to link an item that is already linked" ); m_links.push_back( aLink ); } void Unlink( const LINKED_ITEM* aLink ) { -#ifdef DEBUG - assert ( alg::contains( m_links, aLink ) ); -#endif - + wxCHECK_MSG( alg::contains( m_links, aLink ), /* void */, + "Trying to unlink an item that is not linked" ); alg::delete_matching( m_links, aLink ); }