napi_async_cleanup_hook


napi_add_async_cleanup_hook 一起使用的函数指针。当环境被拆除时,它将被调用。

¥Function pointer used with napi_add_async_cleanup_hook. It will be called when the environment is being torn down.

回调函数必须满足以下签名:

¥Callback functions must satisfy the following signature:

typedef void (*napi_async_cleanup_hook)(napi_async_cleanup_hook_handle handle,
                                        void* data); 

函数体应启动异步清理操作,在清理操作结束时必须在调用 napi_remove_async_cleanup_hook 时传递 handle

¥The body of the function should initiate the asynchronous cleanup actions at the end of which handle must be passed in a call to napi_remove_async_cleanup_hook.