Skip to content
Snippets Groups Projects
Commit f84be146 authored by Alex Hultman's avatar Alex Hultman Committed by Andy Green
Browse files

Don't destroy ev/uv loops if they haven't been created yet

parent 0c3cc2ef
No related branches found
No related tags found
No related merge requests found
...@@ -138,6 +138,9 @@ lws_libev_destroyloop(struct lws_context *context, int tsi) ...@@ -138,6 +138,9 @@ lws_libev_destroyloop(struct lws_context *context, int tsi)
if (!(context->options & LWS_SERVER_OPTION_LIBEV)) if (!(context->options & LWS_SERVER_OPTION_LIBEV))
return; return;
if (!pt->io_loop_ev)
return;
ev_io_stop(pt->io_loop_ev, &pt->w_accept.ev_watcher); ev_io_stop(pt->io_loop_ev, &pt->w_accept.ev_watcher);
if (context->use_ev_sigint) if (context->use_ev_sigint)
ev_signal_stop(pt->io_loop_ev, ev_signal_stop(pt->io_loop_ev,
......
...@@ -124,6 +124,9 @@ lws_libuv_destroyloop(struct lws_context *context, int tsi) ...@@ -124,6 +124,9 @@ lws_libuv_destroyloop(struct lws_context *context, int tsi)
if (!(context->options & LWS_SERVER_OPTION_LIBUV)) if (!(context->options & LWS_SERVER_OPTION_LIBUV))
return; return;
if (!pt->io_loop_uv)
return;
if (context->use_ev_sigint) if (context->use_ev_sigint)
uv_signal_stop(&pt->w_sigint.uv_watcher); uv_signal_stop(&pt->w_sigint.uv_watcher);
for (m = 0; m < ARRAY_SIZE(sigs); m++) for (m = 0; m < ARRAY_SIZE(sigs); m++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment