when renaming a port, remove the backend's port map entry based on the *old* name (not the new one)

This commit is contained in:
Paul Davis 2020-04-08 18:35:00 -06:00
parent 3188fe00aa
commit dd94d43c46

View file

@ -451,6 +451,7 @@ PortEngineSharedImpl::set_port_name (PortEngine::PortHandle port_handle, const s
return -1;
}
const std::string old_name = port->name();
int ret = port->set_name (newname);
if (ret == 0) {
@ -458,7 +459,7 @@ PortEngineSharedImpl::set_port_name (PortEngine::PortHandle port_handle, const s
RCUWriter<PortMap> map_writer (_portmap);
boost::shared_ptr<PortMap> pm = map_writer.get_copy ();
pm->erase (port->name());
pm->erase (old_name);
pm->insert (make_pair (newname, port));
}