diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-09-27 01:36:47 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-09-27 01:36:47 +0100 |
| commit | 267e21bfb78593bcb87eb24ce01b88d0859566f7 (patch) | |
| tree | eb716ee81a8eea4c1519e46fed93370fe24285c6 /src/lib/server.cc | |
| parent | bf38748add4653a214724f49d55890dae1ce2361 (diff) | |
| parent | 0fa64650da252ce29389b62e5c40f32096dc9c4b (diff) | |
Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
Diffstat (limited to 'src/lib/server.cc')
| -rw-r--r-- | src/lib/server.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/server.cc b/src/lib/server.cc index c1db1e6ac..f0b2d9816 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -39,6 +39,7 @@ #include <libxml++/libxml++.h> #include <boost/algorithm/string.hpp> #include <boost/scoped_array.hpp> +#include <boost/foreach.hpp> #include <string> #include <vector> #include <iostream> @@ -81,15 +82,19 @@ Server::~Server () _full_condition.notify_all (); } - for (vector<boost::thread*>::iterator i = _worker_threads.begin(); i != _worker_threads.end(); ++i) { - (*i)->join (); - delete *i; + BOOST_FOREACH (boost::thread* i, _worker_threads) { + DCPOMATIC_ASSERT (i->joinable ()); + i->join (); + delete i; } _io_service.stop (); _broadcast.io_service.stop (); - _broadcast.thread->join (); + if (_broadcast.thread) { + DCPOMATIC_ASSERT (_broadcast.thread->joinable ()); + _broadcast.thread->join (); + } } /** @param after_read Filled in with gettimeofday() after reading the input from the network. |
