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: Andy Green <andy@warmcat.com>
{
const struct lws_protocols *protocol = NULL;
struct lws_context_per_thread *pt;
- struct lws_vhost *vh, *vh1;
+ struct lws_vhost *vh = NULL, *vh1;
struct lws wsi;
int n, m;
*
* 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) {
wsi.vhost = vh;
protocol = vh->protocols;