Change some asserts to wxCHECKs

Make sure that if these are hit, we don't double-add to m_links

See https://gitlab.com/kicad/code/kicad/-/issues/19049
This commit is contained in:
Jon Evans
2024-11-03 09:04:58 -05:00
parent d4053b36f4
commit bdfeb9068a
+4 -7
View File
@@ -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 );
}