diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:25:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:25:12 +0000 |
commit | 827a4c3faa27e0c186452585b15094eee1119085 (patch) | |
tree | e6a08b0c767863d66f7d4a9de80db5edc7db29be /channels/drdynvc | |
parent | Releasing progress-linux version 3.3.0+dfsg1-1~progress7.99u1. (diff) | |
download | freerdp3-827a4c3faa27e0c186452585b15094eee1119085.tar.xz freerdp3-827a4c3faa27e0c186452585b15094eee1119085.zip |
Merging upstream version 3.5.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'channels/drdynvc')
-rw-r--r-- | channels/drdynvc/client/drdynvc_main.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/channels/drdynvc/client/drdynvc_main.c b/channels/drdynvc/client/drdynvc_main.c index 0b85c0f..968d7e2 100644 --- a/channels/drdynvc/client/drdynvc_main.c +++ b/channels/drdynvc/client/drdynvc_main.c @@ -396,14 +396,13 @@ static void dvcman_channel_free(DVCMAN_CHANNEL* channel) static void dvcman_channel_unref(DVCMAN_CHANNEL* channel) { - DVCMAN* dvcman = NULL; - WINPR_ASSERT(channel); if (InterlockedDecrement(&channel->refCounter)) return; - dvcman = channel->dvcman; - HashTable_Remove(dvcman->channelsById, &channel->channel_id); + DVCMAN* dvcman = channel->dvcman; + if (dvcman) + HashTable_Remove(dvcman->channelsById, &channel->channel_id); } static UINT dvcchannel_send_close(DVCMAN_CHANNEL* channel) @@ -457,7 +456,6 @@ static UINT dvcman_call_on_receive(DVCMAN_CHANNEL* channel, wStream* data) static UINT dvcman_channel_close(DVCMAN_CHANNEL* channel, BOOL perRequest, BOOL fromHashTableFn) { UINT error = CHANNEL_RC_OK; - drdynvcPlugin* drdynvc = NULL; DrdynvcClientContext* context = NULL; WINPR_ASSERT(channel); @@ -466,20 +464,24 @@ static UINT dvcman_channel_close(DVCMAN_CHANNEL* channel, BOOL perRequest, BOOL case DVC_CHANNEL_INIT: break; case DVC_CHANNEL_RUNNING: - drdynvc = channel->dvcman->drdynvc; - context = drdynvc->context; - if (perRequest) - WLog_Print(drdynvc->log, WLOG_DEBUG, "sending close confirm for '%s'", - channel->channel_name); - - error = dvcchannel_send_close(channel); - if (error != CHANNEL_RC_OK) + if (channel->dvcman) { - const char* msg = "error when sending close confirm for '%s'"; + drdynvcPlugin* drdynvc = channel->dvcman->drdynvc; + WINPR_ASSERT(drdynvc); + context = drdynvc->context; if (perRequest) - msg = "error when sending closeRequest for '%s'"; + WLog_Print(drdynvc->log, WLOG_DEBUG, "sending close confirm for '%s'", + channel->channel_name); - WLog_Print(drdynvc->log, WLOG_DEBUG, msg, channel->channel_name); + error = dvcchannel_send_close(channel); + if (error != CHANNEL_RC_OK) + { + const char* msg = "error when sending close confirm for '%s'"; + if (perRequest) + msg = "error when sending closeRequest for '%s'"; + + WLog_Print(drdynvc->log, WLOG_DEBUG, msg, channel->channel_name); + } } channel->state = DVC_CHANNEL_CLOSED; |