From 9e859ad11f270428c4bfc60a1f86d10a929a45cd Mon Sep 17 00:00:00 2001 From: Benoit LeBlanc Date: Thu, 24 Apr 2014 14:07:11 -0400 Subject: [PATCH] rpc_client_stop() : Avoid waiting infinitely for rpc client thread if connection failure occurs while in "synchronous receive" mode. --- libfreerdp/core/gateway/rpc_client.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libfreerdp/core/gateway/rpc_client.c b/libfreerdp/core/gateway/rpc_client.c index 827c528..fea7ffd 100644 --- a/libfreerdp/core/gateway/rpc_client.c +++ b/libfreerdp/core/gateway/rpc_client.c @@ -599,9 +599,12 @@ int rpc_client_start(rdpRpc* rpc) int rpc_client_stop(rdpRpc* rpc) { - SetEvent(rpc->client->StopEvent); + if (rpc->client->SynchronousReceive == FALSE) + { + SetEvent(rpc->client->StopEvent); - WaitForSingleObject(rpc->client->Thread, INFINITE); + WaitForSingleObject(rpc->client->Thread, INFINITE); + } rpc_client_free(rpc); -- 2.7.4