Fixed input_thread shutdown issue if not initiated by user.

This commit is contained in:
Armin Novak 2014-05-26 19:09:25 +02:00
parent 7ed1e8a0f1
commit 0c77671a86
1 changed files with 7 additions and 8 deletions

View File

@ -1279,7 +1279,7 @@ void* xf_update_thread(void* arg)
void* xf_input_thread(void* arg)
{
xfContext *xfc;
HANDLE event;
HANDLE event[2];
XEvent xevent;
wMessageQueue* queue;
int pending_status = 1;
@ -1291,9 +1291,9 @@ void* xf_input_thread(void* arg)
assert(NULL != xfc);
queue = freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE);
event = CreateFileDescriptorEvent(NULL, FALSE, FALSE, xfc->xfds);
while (WaitForSingleObject(event, INFINITE) == WAIT_OBJECT_0)
event[0] = CreateFileDescriptorEvent(NULL, FALSE, FALSE, xfc->xfds);
event[1] = MessageQueue_Event(queue);
while(WaitForMultipleObjects(2, event, FALSE, INFINITE) == WAIT_OBJECT_0)
{
do
{
@ -1317,8 +1317,7 @@ void* xf_input_thread(void* arg)
break;
}
}
while (pending_status);
while(pending_status && WaitForSingleObject(event[1], 0) != WAIT_OBJECT_0);
if(!process_status)
break;
}