pub unsafe extern "C" fn napi_add_env_cleanup_hook(
env: napi_env,
fun: Option<unsafe extern "C" fn(arg: *mut c_void)>,
arg: *mut c_void,
) -> napi_statusAvailable on crate features
napi and api-11 only.Expand description
Registers a clean-up hook for releasing resources when the environment exits.
§Arguments
-
env- Current running virtual machine context. -
fun- Function pointer which will be triggered when environment is destroy. -
arg- The argument is passed to the function pointer ‘fun’.
§Returns
- Returns the function execution status.
Available since API-level: 11