From 67f688b97aa5afde455674dbe28297a89d817503 Mon Sep 17 00:00:00 2001 From: "Andrzej J.R. Hunt" Date: Tue, 7 Aug 2012 09:29:35 +0200 Subject: Hopefully cleanly close Server Thread when necessary. Change-Id: If5a850b2f4c813c5a277ed0d4bc5179dd4095b10 --- sd/source/ui/remotecontrol/Server.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sd') diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx index 9be7f2b3d515..cb982de76b96 100644 --- a/sd/source/ui/remotecontrol/Server.cxx +++ b/sd/source/ui/remotecontrol/Server.cxx @@ -112,7 +112,10 @@ void RemoteServer::execute() while ( true ) { fprintf( stderr, "Awaiting a connection.\n" ); - mSocket.acceptConnection( mStreamSocket ); + if ( mSocket.acceptConnection( mStreamSocket ) == osl_Socket_Error ) { + // Socket closed or other problem + return; + } fprintf( stderr, "Accepted a connection!\n" ); listenThread(); } -- cgit