Skip to content
Snippets Groups Projects
Commit 558fa784 authored by jsiegle's avatar jsiegle
Browse files

Prevent orphaned processors when splitters are deleted

parent 3ea8b8dd
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment