summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/engine/LV2Node.cpp5
-rw-r--r--src/engine/events/CreateNode.cpp14
-rw-r--r--src/engine/events/CreateNode.hpp2
3 files changed, 14 insertions, 7 deletions
diff --git a/src/engine/LV2Node.cpp b/src/engine/LV2Node.cpp
index 92f32b3c..df2ccbb2 100644
--- a/src/engine/LV2Node.cpp
+++ b/src/engine/LV2Node.cpp
@@ -60,8 +60,9 @@ LV2Node::LV2Node(LV2Plugin* plugin,
LV2Node::~LV2Node()
{
- for (uint32_t i=0; i < _polyphony; ++i)
- slv2_instance_free((*_instances)[i]);
+ if (_instances)
+ for (uint32_t i=0; i < _polyphony; ++i)
+ slv2_instance_free((*_instances)[i]);
delete _instances;
}
diff --git a/src/engine/events/CreateNode.cpp b/src/engine/events/CreateNode.cpp
index 48d25348..966f96c1 100644
--- a/src/engine/events/CreateNode.cpp
+++ b/src/engine/events/CreateNode.cpp
@@ -54,6 +54,7 @@ CreateNode::CreateNode(
, _plugin_uri(plugin_uri)
, _polyphonic(polyphonic)
, _patch(NULL)
+ , _plugin(NULL)
, _node(NULL)
, _compiled_patch(NULL)
, _node_already_exists(false)
@@ -83,16 +84,16 @@ CreateNode::pre_process()
_patch = _engine.engine_store()->find_patch(_path.parent());
- PluginImpl* const plugin = (_plugin_label == "")
+ _plugin = (_plugin_label == "")
? _engine.node_factory()->plugin(_plugin_uri.str())
: _engine.node_factory()->plugin(_plugin_type, _plugin_lib, _plugin_label);
- if (_patch && plugin) {
+ if (_patch && _plugin) {
- _node = plugin->instantiate(_path.name(), _polyphonic, _patch, _engine);
- _node->properties().insert(_properties.begin(), _properties.end());
+ _node = _plugin->instantiate(_path.name(), _polyphonic, _patch, _engine);
if (_node != NULL) {
+ _node->properties().insert(_properties.begin(), _properties.end());
_node->activate();
// This can be done here because the audio thread doesn't touch the
@@ -134,10 +135,13 @@ CreateNode::post_process()
} else if (_patch == NULL) {
msg = "Could not find patch '" + _path.parent().str() +"' to add node.";
_responder->respond_error(msg);
- } else if (_node == NULL) {
+ } else if (_plugin == NULL) {
msg = "Unable to load node ";
msg += _path.str() + " (you're missing the plugin " + _plugin_uri.str() + ")";
_responder->respond_error(msg);
+ } else if (_node == NULL) {
+ msg = "Failed to instantiate plugin " + _plugin_uri.str();
+ _responder->respond_error(msg);
} else {
_responder->respond_ok();
_engine.broadcaster()->send_object(_node, true); // yes, send ports
diff --git a/src/engine/events/CreateNode.hpp b/src/engine/events/CreateNode.hpp
index e44008e4..8f2379b0 100644
--- a/src/engine/events/CreateNode.hpp
+++ b/src/engine/events/CreateNode.hpp
@@ -25,6 +25,7 @@
namespace Ingen {
class PatchImpl;
+class PluginImpl;
class NodeImpl;
class CompiledPatch;
@@ -59,6 +60,7 @@ private:
std::string _plugin_label;
bool _polyphonic;
PatchImpl* _patch;
+ PluginImpl* _plugin;
NodeImpl* _node;
CompiledPatch* _compiled_patch; ///< Patch's new process order
bool _node_already_exists;