TestDecorator does assume ownership!
Brought to you by:
blep
According to the documentation, TestDecorator "does not assume ownership of the test it decorates":
http://cppunit.cvs.sourceforge.net/viewvc/cppunit/cppunit/include/cppunit/extensions/TestDecorator.h?revision=1.10
But TestDecorator does actually take ownership! Its destructor deletes test it has decorated:
http://cppunit.cvs.sourceforge.net/viewvc/cppunit/cppunit/src/cppunit/TestDecorator.cpp?revision=1.2
So I'd suggest to just update the documentation, according to the attached patch. Otherwise TestDecorator would have been a little bit too much like the TestReference class I've just proposed, at the Help forum :-) Please have a look:
http://sourceforge.net/forum/forum.php?thread_id=1880533&forum_id=37108
A patch for the documentation of TestDecorator