diff options
author | Petr Rockai <prockai@redhat.com> | 2014-10-01 16:04:21 +0200 |
---|---|---|
committer | Petr Rockai <prockai@redhat.com> | 2014-11-18 19:02:12 +0100 |
commit | 256b413609f0b616e6803f946cd4d5f01cfb0319 (patch) | |
tree | cdf9aea4a05e5ef2b077a88dde9d62d55b2aa71a | |
parent | f729e0c74f9fd111e8862c30dce313e2bc1249e1 (diff) | |
download | lvm2-256b413609f0b616e6803f946cd4d5f01cfb0319.tar.gz |
test: Fix a segfault in the test runner.
-rw-r--r-- | test/lib/brick-shelltest.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/lib/brick-shelltest.h b/test/lib/brick-shelltest.h index 7a2b8f0db..99e663974 100644 --- a/test/lib/brick-shelltest.h +++ b/test/lib/brick-shelltest.h @@ -600,11 +600,11 @@ struct IO : Sink { Observer &observer() { return *_observer; } IO() { - sinks.push_back( _observer = new Observer ); + clear(); } /* a stealing copy constructor */ - IO( const IO &io ) : sinks( io.sinks ), sources( io.sources ) + IO( const IO &io ) : sinks( io.sinks ), sources( io.sources ), _observer( io._observer ) { io.sinks.clear(); io.sources.clear(); @@ -619,6 +619,7 @@ struct IO : Sink { for ( Sinks::iterator i = sinks.begin(); i != sinks.end(); ++i ) delete *i; sinks.clear(); + sinks.push_back( _observer = new Observer ); } ~IO() { close(); clear(); } |