From dc1bb0088e8fbb92c81beb55341dcb7b4079717f Mon Sep 17 00:00:00 2001 From: Pleuvens Date: Sat, 14 Oct 2023 13:07:05 +0200 Subject: [PATCH] doc: uv_close should be called after exit callback (#4164) Fixes: https://github.com/libuv/libuv/issues/1911 --- docs/src/guide/processes.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/src/guide/processes.rst b/docs/src/guide/processes.rst index c1278f17..99d65c40 100644 --- a/docs/src/guide/processes.rst +++ b/docs/src/guide/processes.rst @@ -53,6 +53,8 @@ ID of the child process. The exit callback will be invoked with the *exit status* and the type of *signal* which caused the exit. +Note that it is important **not** to call ``uv_close`` before the exit callback. + .. rubric:: spawn/main.c .. literalinclude:: ../../code/spawn/main.c :language: c @@ -126,7 +128,8 @@ of ``uv_kill`` is:: For processes started using libuv, you may use ``uv_process_kill`` instead, which accepts the ``uv_process_t`` watcher as the first argument, rather than -the pid. In this case, **remember to call** ``uv_close`` on the watcher. +the pid. In this case, **remember to call** ``uv_close`` on the watcher _after_ +the exit callback has been called. Signals -------