diff options
Diffstat (limited to 'binaryurp/source/bridge.cxx')
-rw-r--r-- | binaryurp/source/bridge.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx index cb69b0c09859..63cc9a70a85e 100644 --- a/binaryurp/source/bridge.cxx +++ b/binaryurp/source/bridge.cxx @@ -255,10 +255,18 @@ void Bridge::terminate(bool final) { osl::MutexGuard g2(mutex_); tp = threadPool_; threadPool_ = 0; - assert(!(reader_.is() && isThread(reader_.get()))); - std::swap(reader_, r); - assert(!(writer_.is() && isThread(writer_.get()))); - std::swap(writer_, w); + if (reader_.is()) { + if (!isThread(reader_.get())) { + r = reader_; + } + reader_.clear(); + } + if (writer_.is()) { + if (!isThread(writer_.get())) { + w = writer_; + } + writer_.clear(); + } state_ = STATE_FINAL; } assert(!(r.is() && w.is())); |