From d6b79ffb1ba38665865ce74d63d4b80a0cb2fda4 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 30 Sep 2019 09:35:24 -0400 Subject: [PATCH] doc: improve uv_fs_readdir() cleanup docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é --- docs/src/fs.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/fs.rst b/docs/src/fs.rst index aabe49b3..2ef49b0a 100644 --- a/docs/src/fs.rst +++ b/docs/src/fs.rst @@ -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)