Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add implementation for napi_add_finalizer #73

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

bghgary
Copy link
Contributor

@bghgary bghgary commented Feb 1, 2024

@bghgary
Copy link
Contributor Author

bghgary commented Feb 1, 2024

This is a stopgap implementation that needs a more comprehensive implementation for all JS engines once this PR is merged.

Tested manually with macOS with the following code:

auto obj = Napi::ArrayBuffer::New(env, 1000000);
napi_add_finalizer(env, obj, const_cast<char*>("blah"), [](napi_env, void* finalize_data, void*) {
    const char* message = static_cast<const char*>(finalize_data);
    NSLog(@"napi_add_finalizer: callback: %s", message);
}, nullptr, nullptr);

Copy link
Contributor

@PolygonalSun PolygonalSun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bghgary bghgary enabled auto-merge (squash) February 1, 2024 22:27
@bghgary bghgary merged commit c147df4 into BabylonJS:main Feb 1, 2024
15 checks passed
bghgary added a commit to BabylonJS/BabylonNative that referenced this pull request Feb 5, 2024
See #1351. This a stopgap solution. Proper implementation needs to
happen after BabylonJS/JsRuntimeHost#73 is
merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants