Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 71e9c1513ab4
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d3ab50191a61
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 28, 2021

  1. FlowGraphNode: ensure make-before-break ordering when setting an inpu…

    …t that already has something hooked up to it. Fixes #432.
    azonenberg committed Apr 28, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d3ab501 View commit details
Showing with 11 additions and 1 deletion.
  1. +11 −1 scopehal/FlowGraphNode.cpp
12 changes: 11 additions & 1 deletion scopehal/FlowGraphNode.cpp
Original file line number Diff line number Diff line change
@@ -131,13 +131,23 @@ void FlowGraphNode::SetInput(size_t i, StreamDescriptor stream, bool force)
}
}

/*
It's critical to ref the new input *before* dereffing the current one (#432).
Consider a 3-node filter chain A -> B -> C, A and B offscreen.
If we set C's input to A's output, B now has no loads and will get GC'd.
... but now A has no loads!
This causes A to get GC'd right before we hook up C's input to it, and Bad Things(tm) happen.
*/
stream.m_channel->AddRef();

//Deref whatever was there (if anything)
if(m_inputs[i].m_channel != NULL)
m_inputs[i].m_channel->Release();

//All good, we can save the new input
m_inputs[i] = stream;
stream.m_channel->AddRef();
}
else
{