Skip to content

[QUESTION] How does the finalizer actually work? #1212

Closed
@ammarfaizi2

Description

@ammarfaizi2

How does the finalizer actually work?

I have created many objects with:

Napi::Object obj = Napi::Object::New(env);
obj.AddFinalizer(MyDeleter, my_ptr);

But the finalizer is only called when my program exits. I want to make
the NodeJS call MyDeleter() when the object lifetime ends.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions