From 6f7051920a63678746eceff01c868368cbe3e705 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 20 Oct 2019 07:12:51 +0100 Subject: [PATCH] cgi: call init_destroy even though not on available roles list cgi is a role, but it's not an externally-selectable role... it's only used when the mount indicates it should be. That means it's not in the list of EVERY_AVAILABLE_ROLE... make sure its zombie child reaping timer is started at context creation and stopped at destruction. --- lib/core/context.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/core/context.c b/lib/core/context.c index c712263c8..cec3de300 100644 --- a/lib/core/context.c +++ b/lib/core/context.c @@ -509,6 +509,10 @@ lws_create_context(const struct lws_context_creation_info *info) ar->pt_init_destroy(context, info, &context->pt[n], 0); } LWS_FOR_EVERY_AVAILABLE_ROLE_END; + +#if defined(LWS_WITH_CGI) + role_ops_cgi.pt_init_destroy(context, info, &context->pt[n], 0); +#endif } lwsl_info(" Threads: %d each %d fds\n", context->count_threads, @@ -837,6 +841,10 @@ lws_context_destroy3(struct lws_context *context) ar->pt_init_destroy(context, NULL, pt, 1); } LWS_FOR_EVERY_AVAILABLE_ROLE_END; +#if defined(LWS_WITH_CGI) + role_ops_cgi.pt_init_destroy(context, NULL, pt, 1); +#endif + if (context->event_loop_ops->destroy_pt) context->event_loop_ops->destroy_pt(context, n);