uv_close (handle, NULL);
free (handle);
uv_close (handle, close_done_cb);
...
close_done_cb (uv_handle_t * handle) {
free (handle);
}
voiduv_close
(uv_handle_t* handle, uv_close_cb close_cb)Request handle to be closed. close_cb will be called asynchronously after this call. This MUST be called on each handle before memory is released. Moreover, the memory can only be released in close_cb or after it has returned.
Handles that wrap file descriptors are closed immediately but close_cb will still be deferred to the next iteration of the event loop. It gives you a chance to free up any resources associated with the handle.
--
You received this message because you are subscribed to the Google Groups "libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libuv+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libuv/c33f0bbe-b9d2-4dce-9188-e727be30193eo%40googlegroups.com.