X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fserver.cc;h=722b1c81130bde8a81856526c3ad01c357153f3e;hb=366910025ce80231f1192662efe79f76d78ff572;hp=09e0a4bd0524cf91c6a4db010859713bda2d081f;hpb=a8a0dfd1b21de6c0facf965ab119833ff6f790bf;p=dcpomatic.git diff --git a/src/lib/server.cc b/src/lib/server.cc index 09e0a4bd0..722b1c811 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -34,9 +34,13 @@ Server::Server (int port) Server::~Server () { - boost::mutex::scoped_lock lm (_mutex); - _terminate = true; - _io_service.stop (); + { + boost::mutex::scoped_lock lm (_mutex); + _terminate = true; + } + + _acceptor.close (); + stop (); } void @@ -70,3 +74,9 @@ Server::handle_accept (shared_ptr socket, boost::system::error_code cons handle (socket); start_accept (); } + +void +Server::stop () +{ + _io_service.stop (); +}