1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-05 03:50:07 +00:00

Added an AudioProcessor graph assertion.

This commit is contained in:
jules 2013-04-15 15:30:51 +01:00
parent 14cc8bf3c5
commit 2a4aa982d0

View file

@ -965,6 +965,15 @@ AudioProcessorGraph::Node* AudioProcessorGraph::addNode (AudioProcessor* const n
return nullptr;
}
for (int i = nodes.size(); --i >= 0;)
{
if (nodes.getUnchecked(i)->getProcessor() == newProcessor)
{
jassertfalse; // Cannot add the same object to the graph twice!
return nullptr;
}
}
if (nodeId == 0)
{
nodeId = ++lastNodeId;