void freerdp_channels_free(rdpChannels* channels)
{
- int index;
- CHANNEL_OPEN_DATA* pChannelOpenData;
-
if (!channels)
return;
channels->queue = NULL;
}
- for (index = 0; index < channels->clientDataCount; index++)
- {
- pChannelOpenData = &channels->openDataList[index];
-
- if (pChannelOpenData->pInterface)
- {
- free(pChannelOpenData->pInterface);
- pChannelOpenData->pInterface = NULL;
- }
-
- freerdp_channel_remove_open_handle_data(&g_ChannelHandles, pChannelOpenData->OpenHandle);
-
- if (channels->openHandles)
- HashTable_Remove(channels->openHandles,
- (void*)(UINT_PTR)pChannelOpenData->OpenHandle);
- }
-
if (channels->openHandles)
HashTable_Free(channels->openHandles);
void freerdp_channels_close(rdpChannels* channels, freerdp* instance)
{
int index;
+ CHANNEL_OPEN_DATA* pChannelOpenData;
CHANNEL_CLIENT_DATA* pChannelClientData;
freerdp_channels_check_fds(channels, instance);
}
}
+ channels->clientDataCount = 0;
MessageQueue_PostQuit(channels->queue, 0);
+
+ for (index = 0; index < channels->openDataCount; index++)
+ {
+ pChannelOpenData = &channels->openDataList[index];
+
+ if (pChannelOpenData->pInterface)
+ {
+ free(pChannelOpenData->pInterface);
+ pChannelOpenData->pInterface = NULL;
+ }
+
+ freerdp_channel_remove_open_handle_data(&g_ChannelHandles, pChannelOpenData->OpenHandle);
+
+ if (channels->openHandles)
+ HashTable_Remove(channels->openHandles,
+ (void*)(UINT_PTR)pChannelOpenData->OpenHandle);
+ }
+
+ channels->openDataCount = 0;
+ channels->initDataCount = 0;
+ instance->settings->ChannelCount = 0;
}
static UINT VCAPITYPE FreeRDP_VirtualChannelInitEx(LPVOID lpUserParam, LPVOID clientContext,