Skip to content
Snippets Groups Projects
Commit 11d8efef authored by Andy Green's avatar Andy Green
Browse files

context only destroy protocols if init got sent


If for some reason we exit before the protocol init action
(which is delayed for libuv) we should not send the protocol
destroy messages

Signed-off-by: default avatarAndy Green <andy@warmcat.com>
parent ad45efa4
No related branches found
No related tags found
No related merge requests found
...@@ -703,7 +703,7 @@ lws_context_destroy(struct lws_context *context) ...@@ -703,7 +703,7 @@ lws_context_destroy(struct lws_context *context)
{ {
const struct lws_protocols *protocol = NULL; const struct lws_protocols *protocol = NULL;
struct lws_context_per_thread *pt; struct lws_context_per_thread *pt;
struct lws_vhost *vh, *vh1; struct lws_vhost *vh = NULL, *vh1;
struct lws wsi; struct lws wsi;
int n, m; int n, m;
...@@ -754,7 +754,8 @@ lws_context_destroy(struct lws_context *context) ...@@ -754,7 +754,8 @@ lws_context_destroy(struct lws_context *context)
* *
* We can't free things until after the event loop shuts down. * We can't free things until after the event loop shuts down.
*/ */
vh = context->vhost_list; if (context->protocol_init_done)
vh = context->vhost_list;
while (vh) { while (vh) {
wsi.vhost = vh; wsi.vhost = vh;
protocol = vh->protocols; protocol = vh->protocols;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment