From 1f1da18ac6acec9e16e66441160b3949173f1db3 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 2 Jan 2014 00:25:24 +0100 Subject: [PATCH] Add an assertion failure that we don't add the same effect instance twice. Doing this causes hard-to-understand crashes, so just bomb out at once. --- effect_chain.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/effect_chain.cpp b/effect_chain.cpp index f88a4f7..6b7a857 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -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()); -- 2.39.2