diff options
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/control_protocol_manager.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc index c72d3f31d0..6aa0c51da2 100644 --- a/libs/ardour/control_protocol_manager.cc +++ b/libs/ardour/control_protocol_manager.cc @@ -41,7 +41,6 @@ const string ControlProtocolManager::state_node_name = X_("ControlProtocols"); ControlProtocolManager::ControlProtocolManager () { - } ControlProtocolManager::~ControlProtocolManager() @@ -320,13 +319,15 @@ ControlProtocolManager::set_state (const XMLNode& node, int /*version*/) if (prop && string_is_affirmative (prop->value())) { if ((prop = (*citer)->property (X_("name"))) != 0) { ControlProtocolInfo* cpi = cpi_by_name (prop->value()); + if (cpi) { - if (!(*citer)->children().empty()) { - cpi->state = (*citer)->children().front (); - } else { - cpi->state = 0; + + if (cpi->state) { + delete cpi->state; } + cpi->state = new XMLNode (**citer); + if (_session) { instantiate (*cpi); } else { |