master - test: Fix IO sink destructors in the runner.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9752ee8ed2322b9f35f16e259c87b525796d4b2d Commit: 9752ee8ed2322b9f35f16e259c87b525796d4b2d Parent: df27c6404197dd07f1a8a260736111bf5615cf26 Author: Petr Rockai <[email protected]> AuthorDate: Fri Jun 27 00:54:56 2014 +0200 Committer: Petr Rockai <[email protected]> CommitterDate: Thu Feb 5 13:47:17 2015 +0100
test: Fix IO sink destructors in the runner.
--- test/lib/io.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
test/lib/io.h +5 -1
@@ -53,6 +53,7 @@ struct Sink { virtual void outline( bool ) {} virtual void push( std::string x ) = 0; virtual void sync() {} + virtual ~Sink() {} }; struct BufSink : Sink {
@@ -241,11 +242,14 @@ struct IO : Sink {return *this; } - ~IO() { +void clear () { for ( Sinks::iterator i = sinks.begin(); i != sinks.end(); ++i ) delete *i; + sinks.clear (); } + ~IO() { clear(); } + };#endif