MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / ~Reference

Method ~Reference

napi-inl.h:3649–3665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3647
3648template <typename T>
3649inline Reference<T>::~Reference() {
3650 if (_ref != nullptr) {
3651 if (!_suppressDestruct) {
3652 // TODO(legendecas): napi_delete_reference should be invoked immediately.
3653 // Fix this when https://github.com/nodejs/node/pull/55620 lands.
3654#ifdef NODE_API_EXPERIMENTAL_HAS_POST_FINALIZER
3655 Env().PostFinalizer(
3656 [](Napi::Env env, napi_ref ref) { napi_delete_reference(env, ref); },
3657 _ref);
3658#else
3659 napi_delete_reference(_env, _ref);
3660#endif
3661 }
3662
3663 _ref = nullptr;
3664 }
3665}
3666
3667template <typename T>
3668inline Reference<T>::Reference(Reference<T>&& other)

Callers

nothing calls this directly

Calls 2

EnvClass · 0.85
PostFinalizerMethod · 0.80

Tested by

no test coverage detected