From 7967f6270dd7bd7d0d3f75e711bbfb1660be71ae Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 21 Oct 2013 05:17:59 +0200 Subject: [PATCH] bugfix: don't call the dtor on failed objects When a ctor throws, the dtors of sub-objects have already been invoked. The object itself never existed, strictly speaking, and thus the dtor must not be invoked. Usually the runtime system handles matters automatically this way, but since we're doing here placement new into an array, we're responsible ourselves This error was uncovered by compiling with Clang. GCC automatically neutralised this erroneous dtor invocation. --- src/lib/ref-array-impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ref-array-impl.hpp b/src/lib/ref-array-impl.hpp index 7a8b84c82..b0891b526 100644 --- a/src/lib/ref-array-impl.hpp +++ b/src/lib/ref-array-impl.hpp @@ -143,7 +143,7 @@ namespace lib { while (i