Fix subtitle colouring (#152).
[dcpomatic.git] / src / lib / server_finder.cc
index de90e0d5c1380ee85d6429bf8c591f94c9f95dc6..5b67d8048dc197a98d91213c4c0070de61f75d02 100644 (file)
@@ -47,6 +47,7 @@ ServerFinder::ServerFinder ()
 
 void
 ServerFinder::broadcast_thread ()
+try
 {
        boost::system::error_code error;
        boost::asio::io_service io_service;
@@ -88,9 +89,14 @@ ServerFinder::broadcast_thread ()
                dcpomatic_sleep (10);
        }
 }
+catch (...)
+{
+       store_current ();
+}
 
 void
 ServerFinder::listen_thread ()
+try
 {
        while (1) {
                shared_ptr<Socket> sock (new Socket (10));
@@ -117,6 +123,10 @@ ServerFinder::listen_thread ()
                }
        }
 }
+catch (...)
+{
+       store_current ();
+}
 
 bool
 ServerFinder::server_found (string ip) const