diff options
author | Petr Rockai <prockai@redhat.com> | 2014-10-01 16:04:21 +0200 |
---|---|---|
committer | Petr Rockai <prockai@redhat.com> | 2015-02-05 13:51:06 +0100 |
commit | 4686b8cea57d0c36759b73a5448e6c0f99405132 (patch) | |
tree | a617d5573fe7b28422a4271cf732b774af13641e | |
parent | 45e2aee8f9173cc2858da93a4bb9bc289a36bf9d (diff) | |
download | lvm2-4686b8cea57d0c36759b73a5448e6c0f99405132.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(); } |