summaryrefslogtreecommitdiffstats
path: root/src/engine/LV2Node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/LV2Node.cpp')
-rw-r--r--src/engine/LV2Node.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/engine/LV2Node.cpp b/src/engine/LV2Node.cpp
index 9f3995ca..e995bec3 100644
--- a/src/engine/LV2Node.cpp
+++ b/src/engine/LV2Node.cpp
@@ -209,6 +209,14 @@ LV2Node::instantiate(BufferFactory& bufs)
// LV2 port symbols are guaranteed to be unique, valid C identifiers
port_name = slv2_value_as_string(slv2_port_get_symbol(plug, id));
+
+ if (!Symbol::is_valid(port_name)) {
+ error << "Plugin " << _lv2_plugin->uri() << " port " << j
+ << " has illegal symbol `" << port_name << "'" << endl;
+ ret = false;
+ break;
+ }
+
assert(port_name.find("/") == string::npos);
port_path = path().child(port_name);
@@ -261,12 +269,8 @@ LV2Node::instantiate(BufferFactory& bufs)
}
if (data_type == PortType::UNKNOWN || direction == UNKNOWN) {
- delete _ports;
- _ports = NULL;
- delete _instances;
- _instances = NULL;
ret = false;
- goto done;
+ break;
}
if (val.type() == Atom::NIL)
@@ -319,7 +323,16 @@ LV2Node::instantiate(BufferFactory& bufs)
_ports->at(j) = port;
}
-done:
+ if (!ret) {
+ for (uint32_t i = 0; i < _polyphony; ++i) {
+ slv2_instance_deactivate((*_instances)[i]);
+ }
+ delete _ports;
+ _ports = NULL;
+ delete _instances;
+ _instances = NULL;
+ }
+
delete[] min_values;
delete[] max_values;
delete[] def_values;