summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/AddPortEvent.cpp7
-rw-r--r--src/libs/engine/events/ConnectionEvent.cpp4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/libs/engine/events/AddPortEvent.cpp b/src/libs/engine/events/AddPortEvent.cpp
index 92c9cfb9..4c530227 100644
--- a/src/libs/engine/events/AddPortEvent.cpp
+++ b/src/libs/engine/events/AddPortEvent.cpp
@@ -80,7 +80,12 @@ AddPortEvent::pre_process()
_patch->add_output(new ListNode<Port*>(_patch_port));
else
_patch->add_input(new ListNode<Port*>(_patch_port));
- _ports_array = new Array<Port*>(_patch->num_ports() + 1, _patch->external_ports());
+
+ if (_patch->external_ports())
+ _ports_array = new Array<Port*>(_patch->num_ports() + 1, *_patch->external_ports());
+ else
+ _ports_array = new Array<Port*>(_patch->num_ports() + 1, NULL);
+
_ports_array->at(_patch->num_ports()) = _patch_port;
om->object_store()->add(_patch_port);
diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp
index 652fe801..0faff865 100644
--- a/src/libs/engine/events/ConnectionEvent.cpp
+++ b/src/libs/engine/events/ConnectionEvent.cpp
@@ -215,8 +215,8 @@ TypedConnectionEvent<T>::pre_process()
m_patch_listnode = new ListNode<Connection*>(m_connection);
// Need to be careful about patch port connections here and adding a node's
- // parent as a dependant/provider...
- if (src_node->parent() == dst_node->parent()) {
+ // parent as a dependant/provider, or adding a patch as it's own provider...
+ if (src_node != dst_node && src_node->parent() == dst_node->parent()) {
dst_node->providers()->push_back(new ListNode<Node*>(src_node));
src_node->dependants()->push_back(new ListNode<Node*>(dst_node));
}