From 69c5e7fe16b7d9d08db81a6d5e2762f0be3b081f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 6 Jan 2007 19:39:56 +0000 Subject: Added ability to get Raul Thread for current calling context. Strong threading assertions. Flowcanvas port removal fixes. Patch port destruction. Code cleanups, bug fixes. git-svn-id: http://svn.drobilla.net/lad/ingen@234 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/DestroyEvent.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/libs/engine/events/DestroyEvent.cpp') 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, 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, 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); } } -- cgit v1.2.1