From c086f05ba54ebfc12129120066b5bc1754490dce Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 29 Feb 2020 01:51:04 +0100 Subject: Fix order setting I/O names IO::set_name() may fail, in case Port::set_name() fails. In that case the IOProcessor should not update its name. --- libs/ardour/io_processor.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/libs/ardour/io_processor.cc b/libs/ardour/io_processor.cc index 90df95fd29..0bdb812b87 100644 --- a/libs/ardour/io_processor.cc +++ b/libs/ardour/io_processor.cc @@ -245,16 +245,25 @@ IOProcessor::natural_input_streams () const } bool -IOProcessor::set_name (const std::string& name) +IOProcessor::set_name (const std::string& new_name) { - bool ret = SessionObject::set_name (name); + bool ret = true; + + if (name () == new_name) { + return ret; + } if (ret && _own_input && _input) { - ret = _input->set_name (name); + ret = _input->set_name (new_name); } if (ret && _own_output && _output) { - ret = _output->set_name (name); + ret = _output->set_name (new_name); + } + + if (ret) { + ret = SessionObject::set_name (new_name); // never fails + assert (ret); } return ret; -- cgit v1.2.3