diff --git a/channels/encomsp/server/encomsp_main.c b/channels/encomsp/server/encomsp_main.c index bbbe9a748..d32a82089 100644 --- a/channels/encomsp/server/encomsp_main.c +++ b/channels/encomsp/server/encomsp_main.c @@ -338,6 +338,7 @@ static UINT encomsp_server_stop(EncomspServerContext* context) } CloseHandle(context->priv->Thread); + CloseHandle(context->priv->StopEvent); return error; } @@ -368,6 +369,9 @@ void encomsp_server_context_free(EncomspServerContext* context) { if (context) { + if (context->priv->ChannelHandle != INVALID_HANDLE_VALUE) + WTSVirtualChannelClose(context->priv->ChannelHandle); + free(context->priv); free(context); } diff --git a/channels/remdesk/server/remdesk_main.c b/channels/remdesk/server/remdesk_main.c index fd0087384..3e226b869 100644 --- a/channels/remdesk/server/remdesk_main.c +++ b/channels/remdesk/server/remdesk_main.c @@ -756,6 +756,7 @@ static UINT remdesk_server_stop(RemdeskServerContext* context) } CloseHandle(context->priv->Thread); + CloseHandle(context->priv->StopEvent); return CHANNEL_RC_OK; } @@ -787,6 +788,9 @@ void remdesk_server_context_free(RemdeskServerContext* context) { if (context) { + if (context->priv->ChannelHandle != INVALID_HANDLE_VALUE) + WTSVirtualChannelClose(context->priv->ChannelHandle); + free(context->priv); free(context); }