Stub player.
[dcpomatic.git] / src / lib / server.cc
index 09e0a4bd0524cf91c6a4db010859713bda2d081f..722b1c81130bde8a81856526c3ad01c357153f3e 100644 (file)
@@ -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> socket, boost::system::error_code cons
        handle (socket);
        start_accept ();
 }
+
+void
+Server::stop ()
+{
+       _io_service.stop ();
+}