]> sourceware.org Git - lvm2.git/commitdiff
test: Fix IO sink destructors in the runner.
authorPetr Rockai <prockai@redhat.com>
Thu, 26 Jun 2014 22:54:56 +0000 (00:54 +0200)
committerPetr Rockai <prockai@redhat.com>
Thu, 5 Feb 2015 12:47:17 +0000 (13:47 +0100)
test/lib/io.h

index 7f71208e6f6d91c48c31da9a12421ea82d050928..c93b4016aa52579877149d4557d84e1783aba679 100644 (file)
@@ -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
This page took 0.040882 seconds and 5 git commands to generate.