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

This commit is contained in:
Alex Hultman 2016-02-20 11:58:49 +01:00 committed by Andy Green
parent 2209ceb3f5
commit f2ee57e734
2 changed files with 6 additions and 0 deletions

View file

@ -138,6 +138,9 @@ lws_libev_destroyloop(struct lws_context *context, int tsi)
if (!(context->options & LWS_SERVER_OPTION_LIBEV))
return;
if (!pt->io_loop_ev)
return;
ev_io_stop(pt->io_loop_ev, &pt->w_accept.ev_watcher);
if (context->use_ev_sigint)
ev_signal_stop(pt->io_loop_ev,

View file

@ -124,6 +124,9 @@ lws_libuv_destroyloop(struct lws_context *context, int tsi)
if (!(context->options & LWS_SERVER_OPTION_LIBUV))
return;
if (!pt->io_loop_uv)
return;
if (context->use_ev_sigint)
uv_signal_stop(&pt->w_sigint.uv_watcher);
for (m = 0; m < ARRAY_SIZE(sigs); m++)