diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-07-03 20:36:20 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-07-03 20:36:20 +0100 |
| commit | 8862cbbb7e857c90d405069ad7d41a8d58029194 (patch) | |
| tree | ebce1a0209f05784f96321be82236d28b647e37a /src/lib/encode_server.cc | |
| parent | a4c5a9ff48c4cec51e3488f4f8692bf2a2f82dca (diff) | |
Remove several exception-throwing asserts from destructors.
Diffstat (limited to 'src/lib/encode_server.cc')
| -rw-r--r-- | src/lib/encode_server.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc index f318da03b..7e0152003 100644 --- a/src/lib/encode_server.cc +++ b/src/lib/encode_server.cc @@ -85,15 +85,23 @@ EncodeServer::~EncodeServer () } BOOST_FOREACH (boost::thread* i, _worker_threads) { - DCPOMATIC_ASSERT (i->joinable ()); - i->join (); + /* Ideally this would be a DCPOMATIC_ASSERT(i->joinable()) but we + can't throw exceptions from a destructor. + */ + if (i->joinable ()) { + i->join (); + } delete i; } _broadcast.io_service.stop (); if (_broadcast.thread) { - DCPOMATIC_ASSERT (_broadcast.thread->joinable ()); - _broadcast.thread->join (); + /* Ideally this would be a DCPOMATIC_ASSERT(_broadcast.thread->joinable()) but we + can't throw exceptions from a destructor. + */ + if (_broadcast.thread->joinable ()) { + _broadcast.thread->join (); + } } } |
