summaryrefslogtreecommitdiffstats
path: root/src/server/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-04-01 16:46:05 -0400
committerDavid Robillard <d@drobilla.net>2021-04-01 16:46:05 -0400
commitfef4ce2b39b1a00609122fe37e2378be2fa9319f (patch)
treebe56791e34ed193e39ec574142a02c50f2add45c /src/server/events
parent7fcd07e25150bf5dbcded3334aff5c845926391e (diff)
downloadingen-fef4ce2b39b1a00609122fe37e2378be2fa9319f.tar.gz
ingen-fef4ce2b39b1a00609122fe37e2378be2fa9319f.tar.bz2
ingen-fef4ce2b39b1a00609122fe37e2378be2fa9319f.zip
Fix deleting connected ports in subgraphs
Diffstat (limited to 'src/server/events')
-rw-r--r--src/server/events/Delete.cpp2
-rw-r--r--src/server/events/DisconnectAll.cpp12
2 files changed, 13 insertions, 1 deletions
diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp
index cd045820..7b284902 100644
--- a/src/server/events/Delete.cpp
+++ b/src/server/events/Delete.cpp
@@ -166,7 +166,7 @@ Delete::execute(RunContext& ctx)
}
GraphImpl* parent = _block ? _block->parent_graph() : nullptr;
- if (_port) {
+ if (_ports_array && _port) {
// Adjust port indices if necessary
for (size_t i = 0; i < _ports_array->size(); ++i) {
PortImpl* const port = _ports_array->at(i);
diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp
index 0442ddd9..35254ba0 100644
--- a/src/server/events/DisconnectAll.cpp
+++ b/src/server/events/DisconnectAll.cpp
@@ -122,6 +122,18 @@ DisconnectAll::pre_process(PreProcessContext& ctx)
dynamic_cast<InputPort*>(a->head())));
}
+ // Create disconnect events to erase adjacent arcs in parent's parent
+ if (_port && _parent->parent()) {
+ GraphImpl* parent_parent = dynamic_cast<GraphImpl*>(_parent->parent());
+ for (const auto& a : adjacent_arcs(parent_parent)) {
+ _impls.push_back(
+ new Disconnect::Impl(_engine,
+ parent_parent,
+ dynamic_cast<PortImpl*>(a->tail()),
+ dynamic_cast<InputPort*>(a->head())));
+ }
+ }
+
if (!_deleting && ctx.must_compile(*_parent)) {
if (!(_compiled_graph = compile(*_engine.maid(), *_parent))) {
return Event::pre_process_done(Status::COMPILATION_FAILED);