From ed7ea1eb71d1cc4f68e31cd4815c6cbc04fd7818 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 9 Feb 2010 19:08:35 +0000 Subject: 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 --- src/engine/events/CreatePort.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/engine/events/CreatePort.cpp') 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(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()) -- cgit v1.2.1