diff options
author | David Robillard <d@drobilla.net> | 2010-02-09 19:08:35 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-09 19:08:35 +0000 |
commit | ed7ea1eb71d1cc4f68e31cd4815c6cbc04fd7818 (patch) | |
tree | fe2b5646dc0755ff7947cb9167e3d135a16a800f /src/engine/events/CreatePort.cpp | |
parent | ece287591afab6a1b8b944c0cab675a9f08ba97e (diff) | |
download | ingen-ed7ea1eb71d1cc4f68e31cd4815c6cbc04fd7818.tar.gz ingen-ed7ea1eb71d1cc4f68e31cd4815c6cbc04fd7818.tar.bz2 ingen-ed7ea1eb71d1cc4f68e31cd4815c6cbc04fd7818.zip |
Fix bugs with child blocking events.
e.g. CreatePortEvent as a child of SetMetadataEvent would doubly unblock the
EventSource, so future blocking events wouldn't actually block and crash
bugs and/or patch corruption could result.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2435 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/events/CreatePort.cpp')
-rw-r--r-- | src/engine/events/CreatePort.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/engine/events/CreatePort.cpp b/src/engine/events/CreatePort.cpp index f1656019..63ebede2 100644 --- a/src/engine/events/CreatePort.cpp +++ b/src/engine/events/CreatePort.cpp @@ -51,7 +51,7 @@ CreatePort::CreatePort( const Raul::URI& type, bool is_output, const Resource::Properties& properties) - : QueuedEvent(engine, request, timestamp, true) + : QueuedEvent(engine, request, timestamp, bool(request)) , _error(NO_ERROR) , _path(path) , _type(type) @@ -92,7 +92,9 @@ CreatePort::pre_process() size_t buffer_size = _engine.driver()->buffer_size(); - const uint32_t old_num_ports = _patch->num_ports(); + const uint32_t old_num_ports = (_patch->external_ports()) + ? _patch->external_ports()->size() + : 0; _patch_port = _patch->create_port(*_engine.buffer_factory(), _path.symbol(), _data_type, buffer_size, _is_output); if (_patch->parent()) @@ -113,7 +115,7 @@ CreatePort::pre_process() else _ports_array = new Raul::Array<PortImpl*>(old_num_ports + 1, NULL); - _ports_array->at(_patch->num_ports()-1) = _patch_port; + _ports_array->at(old_num_ports) = _patch_port; _engine.engine_store()->add(_patch_port); if (!_patch->parent()) |