Add an assertion failure that we don't add the same effect instance twice.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 1 Jan 2014 23:25:24 +0000 (00:25 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 1 Jan 2014 23:25:24 +0000 (00:25 +0100)
Doing this causes hard-to-understand crashes, so just bomb out at once.

effect_chain.cpp

index f88a4f7..6b7a857 100644 (file)
@@ -66,6 +66,10 @@ void EffectChain::add_output(const ImageFormat &format, OutputAlphaFormat alpha_
 
 Node *EffectChain::add_node(Effect *effect)
 {
+       for (unsigned i = 0; i < nodes.size(); ++i) {
+               assert(nodes[i]->effect != effect);
+       }
+
        char effect_id[256];
        sprintf(effect_id, "eff%u", (unsigned)nodes.size());