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); [in] handle:在异步清理完成后必须传递给napi_remove_async_cleanup_hook的句柄。[in] data:传递给napi_add_async_cleanup_hook的数据。
函数主体应在最后启动异步清理操作,清理完成后必须在调用 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.】