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

Python objects "leak" when passed to Javascript #33

Closed
mdboom opened this issue May 18, 2018 · 1 comment
Closed

Python objects "leak" when passed to Javascript #33

mdboom opened this issue May 18, 2018 · 1 comment

Comments

@mdboom
Copy link
Collaborator

mdboom commented May 18, 2018

Since there is no concept of a finalizer in Javascript, there is no way to decrement the Python object's reference count when it goes out of Javascript scope or is collected by the gc.

One solution is to add such a feature to Javascript (lol).

Another might be to pass weak references to Javascript and just let Python deal with lifetimes alone, and accessing a dead object from Javascript would raise an exception.

@mdboom mdboom added bug Something isn't working WASM Python/C API cpython performance and removed bug Something isn't working labels May 22, 2018
@mdboom
Copy link
Collaborator Author

mdboom commented Jul 10, 2018

This is mostly addressed by the new feature to explicitly destroy Python objects from Javascript.

@mdboom mdboom closed this as completed Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant