diff options
Diffstat (limited to 'src/libs/engine/events/DestroyEvent.cpp')
-rw-r--r-- | src/libs/engine/events/DestroyEvent.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp index 9801f0fe..26902697 100644 --- a/src/libs/engine/events/DestroyEvent.cpp +++ b/src/libs/engine/events/DestroyEvent.cpp @@ -43,6 +43,7 @@ DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, Frame _patch_node_listnode(NULL), _patch_port_listnode(NULL), _store_treenode(NULL), + _ports_array(NULL), _process_order(NULL), _disconnect_node_event(NULL), _disconnect_port_event(NULL) @@ -60,6 +61,7 @@ DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, Frame _patch_node_listnode(NULL), _patch_port_listnode(NULL), _store_treenode(NULL), + _ports_array(NULL), _process_order(NULL), _disconnect_node_event(NULL), _disconnect_port_event(NULL) @@ -131,11 +133,8 @@ DestroyEvent::pre_process() if (_port->parent_patch()->enabled()) { // FIXME: is this called multiple times? _process_order = _port->parent_patch()->build_process_order(); - // Remove port to be removed from the process order so it isn't executed by - // Patch::run and can safely be destroyed - //for (size_t i=0; i < _process_order->size(); ++i) - // if (_process_order->at(i) == _port) - // _process_order->at(i) = NULL; // ew, gap + _ports_array = _port->parent_patch()->build_ports_array(); + assert(_ports_array->size() == _port->parent_patch()->num_ports()); } } @@ -168,7 +167,13 @@ DestroyEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) if (_port->parent_patch()->process_order() != NULL) _engine.maid()->push(_port->parent_patch()->process_order()); + _port->parent_patch()->process_order(_process_order); + + if (_port->parent_patch()->external_ports() != NULL) + _engine.maid()->push(_port->parent_patch()->external_ports()); + + _port->parent_patch()->external_ports(_ports_array); } } |