Skip to content

[Question] How to properly store constructor for later use? #1196

@neko-para

Description

@neko-para

I have some functions that would create an instance of my exported class, thus I need to get the ctor of it. I've tried to store it inside the context opaque, but this would cause object leak, as there's no callback to release the opaque itself (thus ctor got leak together). I've checked the samples, but point.c doesn't provide a function to create a point instance directly. I believe storing ctor to globalObject could solve this problem, but I don't want to pollute it.

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