Skip to content

fix: dispose cy instance and autosave timer on tab close #341

Merged
pradeeban merged 1 commit intoControlCore-Project:devfrom
avinxshKD:fix/graph-dispose-leak
Feb 23, 2026
Merged

fix: dispose cy instance and autosave timer on tab close #341
pradeeban merged 1 commit intoControlCore-Project:devfrom
avinxshKD:fix/graph-dispose-leak

Conversation

@avinxshKD
Copy link

Closes #338

Added dispose() to CoreGraph in 1-core.js which calls cy.destroy(), clears the pending autosave setTimeout, and nulls out cy and dispatcher. Wired it into the useEffect cleanup in GraphArea.jsx and at the top of closeTab() in TabBar.jsx so it fires both on unmount and on explicit tab close.

Without this, every closed tab left a full cytoscape instance (canvas + WebGL context), the Konva stage, edgehandles state, and a live setTimeout all sitting in memory. Open 10 tabs, close them, heap grows forever.

@avinxshKD
Copy link
Author

avinxshKD commented Feb 23, 2026

Hey @pradeeban changes are minimal, no extra lines

@pradeeban pradeeban merged commit 5b79fb7 into ControlCore-Project:dev Feb 23, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants