mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Refactored channel error handling
* Fix WINPR_ASSERT if a client can not allocate new resources, terminated cleanly instead. * Add WINPR_ASSERT for lots of channel arguments
This commit is contained in:
@@ -1175,18 +1175,23 @@ static UINT encomsp_virtual_channel_event_disconnected(encomspPlugin* encomsp)
|
||||
if (encomsp->OpenHandle == 0)
|
||||
return CHANNEL_RC_OK;
|
||||
|
||||
if (MessageQueue_PostQuit(encomsp->queue, 0) &&
|
||||
(WaitForSingleObject(encomsp->thread, INFINITE) == WAIT_FAILED))
|
||||
if (encomsp->queue && encomsp->thread)
|
||||
{
|
||||
rc = GetLastError();
|
||||
WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", rc);
|
||||
return rc;
|
||||
if (MessageQueue_PostQuit(encomsp->queue, 0) &&
|
||||
(WaitForSingleObject(encomsp->thread, INFINITE) == WAIT_FAILED))
|
||||
{
|
||||
rc = GetLastError();
|
||||
WLog_ERR(TAG, "WaitForSingleObject failed with error %" PRIu32 "", rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
MessageQueue_Free(encomsp->queue);
|
||||
CloseHandle(encomsp->thread);
|
||||
encomsp->queue = NULL;
|
||||
encomsp->thread = NULL;
|
||||
|
||||
WINPR_ASSERT(encomsp->channelEntryPoints.pVirtualChannelCloseEx);
|
||||
rc = encomsp->channelEntryPoints.pVirtualChannelCloseEx(encomsp->InitHandle,
|
||||
encomsp->OpenHandle);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user