doc: improve uv_fs_readdir() cleanup docs

When cleaning up after uv_fs_readdir(), it is important to
call uv_fs_req_cleanup() on the readdir request prior to calling
uv_fs_closedir(), because the latter frees memory that the
former needs in order to do its job.

PR-URL: https://github.com/libuv/libuv/pull/2497
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
cjihrig 2019-09-30 09:35:24 -04:00
parent f47f01b57c
commit d6b79ffb1b
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -295,7 +295,8 @@ API
.. note::
On success this function allocates memory that must be freed using
`uv_fs_req_cleanup()`.
`uv_fs_req_cleanup()`. `uv_fs_req_cleanup()` must be called before
closing the directory with `uv_fs_closedir()`.
.. c:function:: int uv_fs_scandir(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, uv_fs_cb cb)
.. c:function:: int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent)