mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
context protocol destroy provide nonnull wsi with context
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
77ec61e44f
commit
e70c63ba8f
1 changed files with 5 additions and 1 deletions
|
@ -253,6 +253,7 @@ LWS_VISIBLE void
|
|||
lws_context_destroy(struct lws_context *context)
|
||||
{
|
||||
const struct lws_protocols *protocol = NULL;
|
||||
struct lws wsi;
|
||||
int n;
|
||||
|
||||
lwsl_notice("%s\n", __func__);
|
||||
|
@ -260,6 +261,9 @@ lws_context_destroy(struct lws_context *context)
|
|||
if (!context)
|
||||
return;
|
||||
|
||||
memset(&wsi, 0, sizeof(wsi));
|
||||
wsi.context = context;
|
||||
|
||||
#ifdef LWS_LATENCY
|
||||
if (context->worst_latency_info[0])
|
||||
lwsl_notice("Worst latency: %s\n", context->worst_latency_info);
|
||||
|
@ -292,7 +296,7 @@ lws_context_destroy(struct lws_context *context)
|
|||
protocol = context->protocols;
|
||||
if (protocol) {
|
||||
while (protocol->callback) {
|
||||
protocol->callback(NULL,
|
||||
protocol->callback(&wsi,
|
||||
LWS_CALLBACK_PROTOCOL_DESTROY,
|
||||
NULL, NULL, 0);
|
||||
protocol++;
|
||||
|
|
Loading…
Add table
Reference in a new issue