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

Memory leak caused by detached nodes after calling Pane.dispose() #637

Open
michaeldll opened this issue Dec 5, 2024 · 1 comment
Open

Comments

@michaeldll
Copy link

michaeldll commented Dec 5, 2024

Hello there, thank you for your work. Been using your library for a long time.

However, I'm observing a significant memory leak caused by detached Blade DOM elements, even after calling dispose() on their parent Pane:

Screenshot 2024-12-05 at 17 04 29

I followed the instructions here: https://tweakpane.github.io/docs/misc/#disposing.

Reproducing should be fairly simple:

  1. Start a Chrome Detached Nodes memory trace
  2. Call dispose() on a parent Pane
  3. End the trace

Let me know if I'm missing something.

Thanks again.

@cocopon
Copy link
Owner

cocopon commented Jan 9, 2025

Do you clear the variable for the pane? For example:

window.pane = new Pane();
window.pane.dispose();

this code still retains references to detached nodes because window.pane isn't cleared. To avoid that, set it to null after disposing of the pane:

window.pane = new Pane();
window.pane.dispose();

window.pane = null;

A minimal reproduction environment will help in investigating the issue. You can use tools like CodeSandbox to set up the environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants