I have an application which uses libuv library. it runs default loop:
uv_run(uv_default_loop());
How can the application be gracefully exited in case of a failure? Currently I am doing it like in the following example:
uv_tcp_t* tcp = malloc(sizeof(uv_tcp_t));
int r = uv_tcp_init(uv_default_loop(), tcp);
if (r) {
free(tcp);
uv_loop_delete(default_loop);
exit(EXIT_FAILURE);
}
Should uv_loop_delete
function be called? What does it do? Does it drop all pending callback functions? Does it close all currently opened TCP connections? Do I have to do it manually before exiting?
P.S.: Can't add the tag 'libuv' (less than 1500 reputation). Can somebody create and add it?