Fixed deadlock when closing session window.

This commit is contained in:
Benoît LeBlanc 2013-07-18 21:22:41 -04:00
parent e0f77968cb
commit d0a1563cb9
2 changed files with 9 additions and 12 deletions

View File

@ -676,14 +676,6 @@ DWORD mac_client_thread(void* param)
{
int i;
mfContext* mfc = (mfContext*) context;
if (mfc && mfc->thread)
{
WaitForSingleObject(mfc->thread, INFINITE);
CloseHandle(mfc->thread);
mfc->thread = NULL;
}
for (i = 0; i < argc; i++)
{

View File

@ -73,8 +73,7 @@ int mfreerdp_client_stop(rdpContext* context)
MessageQueue_PostQuit(queue, 0);
}
}
if (context->settings->AsyncInput)
else if (context->settings->AsyncInput)
{
wMessageQueue* queue;
queue = freerdp_get_message_queue(context->instance, FREERDP_INPUT_MESSAGE_QUEUE);
@ -87,8 +86,14 @@ int mfreerdp_client_stop(rdpContext* context)
{
mfc->disconnect = TRUE;
}
SetEvent(mfc->stopEvent);
if (mfc->thread)
{
SetEvent(mfc->stopEvent);
WaitForSingleObject(mfc->thread, INFINITE);
CloseHandle(mfc->thread);
mfc->thread = NULL;
}
if (mfc->view_ownership)
{