Bugfix: removing a pin from a Circuit does not crash if the pin was not disconnected before. Now it's disconnected automatically.

This commit is contained in:
Matthias Koefferlein
2026-07-12 00:14:30 +02:00
parent 8eaf5638f8
commit abe9479ced
2 changed files with 20 additions and 0 deletions
+1
View File
@@ -353,6 +353,7 @@ Pin &Circuit::add_pin (const std::string &name)
void Circuit::remove_pin (size_t id)
{
if (id < m_pin_by_id.size () && ! tl::is_null_iterator (m_pin_by_id [id])) {
connect_pin (id, 0);
m_pins.erase (m_pin_by_id [id]);
m_pin_by_id [id] = pin_list::iterator ();
}