diff --git a/server/shadow/shadow_server.c b/server/shadow/shadow_server.c index 11b6090b3..aaf037d2e 100644 --- a/server/shadow/shadow_server.c +++ b/server/shadow/shadow_server.c @@ -344,6 +344,14 @@ void* shadow_server_thread(rdpShadowServer* server) shadow_subsystem_stop(server->subsystem); + /* Signal to the clients that server is being stopped and wait for them + * to disconnect. */ + MessageQueue_PostQuit(subsystem->MsgPipe->Out, 0); + while(ArrayList_Count(server->clients) > 0) + { + Sleep(100); + } + ExitThread(0); return NULL;