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

Is it necessary to call free() for js class binding instances? #4410

Open
rouzwelt opened this issue Jan 17, 2025 · 0 comments
Open

Is it necessary to call free() for js class binding instances? #4410

rouzwelt opened this issue Jan 17, 2025 · 0 comments
Labels

Comments

@rouzwelt
Copy link
Contributor

rouzwelt commented Jan 17, 2025

Summary

All js class bindings come with a free() method, which frees up the memory allocated for them when they are instantiated, let's say there is a loop on js which inside that class binding is instantiated, does some other stuff and just then WITHOUT calling free() we go to next iteration, would this cause memory leak and those instances on each iteration persist on memory?
or would they automatically end up in js gc and go out of scope themselves?

for (;;) {
  const bindingClassInstance = new BindingClass();
  // do something and NOT call free() on above instance
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant