diff options
Diffstat (limited to 'src/lib/server.cc')
| -rw-r--r-- | src/lib/server.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/server.cc b/src/lib/server.cc index c1be5735e..6e3781dca 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -41,13 +41,7 @@ Server::Server (int port, int timeout) Server::~Server () { - { - boost::mutex::scoped_lock lm (_mutex); - _terminate = true; - } - - _acceptor.close (); - stop (); + stop(); } @@ -89,5 +83,11 @@ Server::handle_accept (shared_ptr<Socket> socket, boost::system::error_code cons void Server::stop () { + { + boost::mutex::scoped_lock lm (_mutex); + _terminate = true; + } + + _acceptor.close (); _io_service.stop (); } |
