context protocol destroy provide nonnull wsi with context

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2015-12-18 01:08:14 +08:00
parent 77ec61e44f
commit e70c63ba8f

View file

@ -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++;