1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

libuv: run loop to clean up per-pt objects before exiting

This commit is contained in:
Andy Green 2018-03-29 11:47:49 +08:00
parent 80d84896f1
commit b9c7f3df92

View file

@ -338,12 +338,12 @@ lws_libuv_destroyloop(struct lws_context *context, int tsi)
uv_idle_stop(&pt->uv_idle);
uv_close((uv_handle_t *)&pt->uv_idle, lws_uv_close_cb);
if (pt->ev_loop_foreign)
return;
while (budget-- && uv_run(pt->io_loop_uv, UV_RUN_NOWAIT))
;
if (pt->ev_loop_foreign)
return;
uv_stop(pt->io_loop_uv);
uv_walk(pt->io_loop_uv, lws_uv_walk_cb, NULL);
while (uv_run(pt->io_loop_uv, UV_RUN_NOWAIT))
@ -502,7 +502,7 @@ lws_libuv_stop(struct lws_context *context)
}
}
lwsl_info("%s: feels everything closed\n", __func__);
lwsl_info("%s: started closing all wsi\n", __func__);
if (context->count_wsi_allocated == 0)
lws_libuv_kill(context);
}