Fixed channel duplicate disconnect handling

This commit is contained in:
Armin Novak 2018-04-09 11:10:03 +02:00
parent d784954bca
commit 1761a66b5e

View File

@ -682,7 +682,7 @@ static UINT rail_virtual_channel_event_connected(railPlugin* rail, LPVOID pData,
}
if (!(rail->thread = CreateThread(NULL, 0,
rail_virtual_channel_client_thread, (void*) rail, 0,
rail_virtual_channel_client_thread, (void*) rail, 0,
NULL)))
{
WLog_ERR(TAG, "CreateThread failed!");
@ -703,6 +703,9 @@ static UINT rail_virtual_channel_event_disconnected(railPlugin* rail)
{
UINT rc;
if (rail->OpenHandle == 0)
return CHANNEL_RC_OK;
if (MessageQueue_PostQuit(rail->queue, 0)
&& (WaitForSingleObject(rail->thread, INFINITE) == WAIT_FAILED))
{