21 Nov
2008
21 Nov
'08
7:56 p.m.
Peter Klotz wrote:
James Sutherland wrote:
Try compiling a debug version. That will give you line numbers to help you track it down easier. James
Found the problem. It was a non virtual destructor in class test_unit.
Since test_unit is the base class of test_case, test_suite and master_test_suite_t it needs a virtual destructor.
No. It does not. We never delete test units through pointer to test_unit.
In deregister_test_unit() a test_unit* pointer is passed which may actually point to a derived class. Calling delete without a virtual destructor leads to undefined behavior (and makes valgrind complain).
deregister_test_unit does not cause delete command. In fact it's being call from destructor. Gennadiy