diff --git a/Source/UI/SignalChainManager.cpp b/Source/UI/SignalChainManager.cpp index d9558c0648ab8078443ce4e7d7f9ea229e1df8e3..e4d9d063b8ca38f03d438e150b632e8b43a03eba 100755 --- a/Source/UI/SignalChainManager.cpp +++ b/Source/UI/SignalChainManager.cpp @@ -188,7 +188,8 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, GenericProcessor* p = (GenericProcessor*) editorArray[index]->getProcessor(); - // need to inform the other source that its merger has disappeared + // if the processor to be removed is a merger, + // we need to inform the other source that its merger has disappeared if (p->isMerger()) { p->switchIO(); @@ -196,6 +197,19 @@ void SignalChainManager::updateVisibleEditors(GenericEditor* activeEditor, p->getSourceNode()->setDestNode(0); } + // if the processor to be removed is a splitter, we need to make sure + // there aren't any orphaned processors + if (p->isSplitter()) + { + p->switchIO(); + if (p->getDestNode() != 0) + { + std::cout << "Found an orphaned signal chain" << std::endl; + p->getDestNode()->setSourceNode(0); + createNewTab(p->getDestNode()->getEditor()); + } + } + editorArray.remove(index); int t = activeEditor->tabNumber();