Index: boost/test/impl/framework.ipp =================================================================== --- boost/test/impl/framework.ipp (revision 52996) +++ boost/test/impl/framework.ipp (working copy) @@ -127,10 +127,11 @@ test_unit_store::value_type const& tu = *m_test_units.begin(); // the delete will erase this element from map - if( ut_detail::test_id_2_unit_type( tu.second->p_id ) == tut_suite ) - delete (test_suite const*)tu.second; + test_unit* tu_ptr = tu.second; + if( ut_detail::test_id_2_unit_type( tu_ptr->p_id ) == tut_suite ) + delete (test_suite const*)tu_ptr; else - delete (test_case const*)tu.second; + delete (test_case const*)tu_ptr; } }