From 5b7e491f98ecff10264dad01eded647e51c24b4e Mon Sep 17 00:00:00 2001 From: Gennadiy Rozental Date: Sat, 28 Nov 2009 09:18:24 +0000 Subject: [PATCH] merge memory fix. Fixes #2889 [SVN r57991] --- include/boost/test/impl/framework.ipp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/boost/test/impl/framework.ipp b/include/boost/test/impl/framework.ipp index ed9919c7..a1e98b37 100644 --- a/include/boost/test/impl/framework.ipp +++ b/include/boost/test/impl/framework.ipp @@ -124,13 +124,14 @@ public: void clear() { while( !m_test_units.empty() ) { - test_unit_store::value_type const& tu = *m_test_units.begin(); + test_unit_store::value_type const& tu = *m_test_units.begin(); + test_unit* tu_ptr = tu.second; // the delete will erase this element from map if( ut_detail::test_id_2_unit_type( tu.second->p_id ) == tut_suite ) - delete static_cast(tu.second); + delete (test_suite const*)tu_ptr; else - delete static_cast(tu.second); + delete (test_case const*)tu_ptr; } }