Another speculative attempt to fix crash on quit.
authorCarl Hetherington <cth@carlh.net>
Thu, 25 May 2017 10:14:30 +0000 (11:14 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 25 May 2017 10:14:30 +0000 (11:14 +0100)
src/lib/server.cc

index 5640843a03daa8e23c827e64868aa0536d406831..1fb3d7d471863a2c3e81ec3c65480c131d2ada47 100644 (file)
@@ -34,8 +34,11 @@ Server::Server (int port)
 
 Server::~Server ()
 {
-       boost::mutex::scoped_lock lm (_mutex);
-       _terminate = true;
+       {
+               boost::mutex::scoped_lock lm (_mutex);
+               _terminate = true;
+       }
+
        _acceptor.close ();
        _io_service.stop ();
 }