From 0d6f0c2fe47b5186e6f46c0d5f7f66bb3f9bd069 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 13 Aug 2008 23:43:56 +0000 Subject: Fix crash when dynamically changing polyphony w/ LADSPA plugins. git-svn-id: http://svn.drobilla.net/lad/ingen@1360 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/LADSPANode.cpp | 6 +++--- src/libs/engine/LV2Node.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libs') diff --git a/src/libs/engine/LADSPANode.cpp b/src/libs/engine/LADSPANode.cpp index 38436046..e922de7c 100644 --- a/src/libs/engine/LADSPANode.cpp +++ b/src/libs/engine/LADSPANode.cpp @@ -70,13 +70,13 @@ LADSPANode::prepare_poly(uint32_t poly) _prepared_instances = new Raul::Array(poly, *_instances); for (uint32_t i = _polyphony; i < _prepared_instances->size(); ++i) { _prepared_instances->at(i) = _descriptor->instantiate(_descriptor, _srate); - if ((*_prepared_instances)[i] == NULL) { + if (_prepared_instances->at(i) == NULL) { cerr << "Failed to instantiate plugin!" << endl; return false; } - if (_activated) - _descriptor->activate((*_prepared_instances)[i]); + if (_activated && _descriptor->activate) + _descriptor->activate(_prepared_instances->at(i)); } return true; diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp index de1e61ca..59d30c7e 100644 --- a/src/libs/engine/LV2Node.cpp +++ b/src/libs/engine/LV2Node.cpp @@ -79,13 +79,13 @@ LV2Node::prepare_poly(uint32_t poly) _prepared_instances->at(i) = slv2_plugin_instantiate( _lv2_plugin->slv2_plugin(), _srate, NULL); - if ((*_prepared_instances)[i] == NULL) { + if (_prepared_instances->at(i) == NULL) { cerr << "Failed to instantiate plugin!" << endl; return false; } if (_activated) - slv2_instance_activate((*_prepared_instances)[i]); + slv2_instance_activate(_prepared_instances->at(i)); } return true; -- cgit v1.2.1