aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Moritz Klammler <moritz@klammler.eu>2014-07-06 06:58:13 +0200
committerGravatar Moritz Klammler <moritz@klammler.eu>2014-07-06 06:58:13 +0200
commit58687aa5e638d365d5e41c1e6c66cbfc44fce85f (patch)
treeaf5ea0fa2a0de994a4d3522e94ff83852e30adb0 /test/CMakeLists.txt
parent339f14b8d1b73db0366afc3a497d566cecf72e1b (diff)
Avoid memory leak when constructor of user-defined type throws exception.
The added check `ctorleak.cpp` demonstrates how the leak can be reproduced. The test appears to pass but it is leaking the storage of the (not created) matrix. I don't know how to make this test fail in the existing test suite but you can run it through Valgrind (or another debugger) to verify the leak. $ ./check.sh ctorleak && valgrind --leak-check=full ./test/ctorleak This patch fixes this leak by adding some try-catch-delete-rethrow blocks to `Eigen/src/Core/util/Memory.h`.
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 4521d07e4..fed5c0e06 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -251,6 +251,8 @@ ei_add_test(bicgstab)
ei_add_test(sparselu)
ei_add_test(sparseqr)
+ei_add_test(ctorleak)
+
# ei_add_test(denseLM)
if(QT4_FOUND)