diff options
author | cjihrig <cjihrig@gmail.com> | 2019-09-30 09:35:24 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-10-06 16:08:04 +0200 |
commit | d6b79ffb1ba38665865ce74d63d4b80a0cb2fda4 (patch) | |
tree | d3283b8870737c4deb981024175d35fa4bb2c426 /docs/src | |
parent | f47f01b57c806f7bcb99e5c7df569a69dd480595 (diff) | |
download | libuv-d6b79ffb1ba38665865ce74d63d4b80a0cb2fda4.tar.gz libuv-d6b79ffb1ba38665865ce74d63d4b80a0cb2fda4.zip |
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>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/fs.rst | 3 |
1 files changed, 2 insertions, 1 deletions
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) |