Skip to content

Resource disposal inside component-exported Resources does not trigger #989

@vados-cosmonic

Description

@vados-cosmonic

Resources that are exported by components should have their disposal functions ([Symbol.dispose]() in JS) called when they are removed from the embedder's scope.

It's unclear if it's simply jco embedders (i.e. transpiled components) that are failing to do this, but a simple use (see #988 ) does not print the disposal message as expected.

Let's ensure that transpiled code properly disposes of resources that are in components. To illustrate, the following code:

{
    using ex1 = new resources.Example();
    console.log('Hello from ex1:', ex1.hello('ex1'));
}

Should trigger the [Symbol.dispose]() on the Example resource inside the component.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions