napi_reference_unref


NAPI_EXTERN napi_status napi_reference_unref(napi_env env,
                                             napi_ref ref,
                                             uint32_t* result); 
  • [in] env:调用 API 的环境。

    ¥[in] env: The environment that the API is invoked under.

  • [in] ref:将减少其引用计数的 napi_ref

    ¥[in] ref: napi_ref for which the reference count will be decremented.

  • [out] result:新的引用计数。

    ¥[out] result: The new reference count.

如果 API 成功,则返回 napi_ok

¥Returns napi_ok if the API succeeded.

此 API 递减传入引用的引用计数并返回生成的引用计数。

¥This API decrements the reference count for the reference passed in and returns the resulting reference count.