
19 Sep
2008
19 Sep
'08
5:31 a.m.
Kevin Sopp <baraclese <at> googlemail.com> writes:
==3513== Invalid read of size 4 ==3513== at 0x40936E0: boost::unit_test::framework_impl::clear() (framework.ipp:133)
Not sure what it complains about. This line delete (test_case const*)tu.second;
deletes instance to unit_test.
Yes, I believe you delete it twice. One time via framework_impl::clear() and then ~test_unit() calls framework::deregister_test_unit( this ); which will try to erase itself from the map again.
These are two distinct operations. clear() will free test unit memory. ~test_unit() will erase itself from framework registry. clear() does not call erase(). Genandiy