Skip to content

[fix] prevent memory leak in SubgraphNode event listeners #1150

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

Merged
merged 1 commit into from
Jul 22, 2025

Conversation

christian-byrne
Copy link
Contributor

SubgraphNode registered event listeners on parent Subgraph but never cleaned them up, causing removed nodes to accumulate in memory. Used AbortController pattern for proper lifecycle management.

Fixes #1124

… on removal

SubgraphNode was registering 6 event listeners on the parent Subgraph but never removing them when the node was deleted. This caused removed nodes to stay in memory and continue responding to events.

Added AbortController to manage all event listeners lifecycle - single abort() call in onRemoved() now properly cleans up all listeners.

Fixes #1124
@christian-byrne christian-byrne merged commit defaef8 into master Jul 22, 2025
4 checks passed
@christian-byrne christian-byrne deleted the fix/subgraph-event-listener-memory-leak branch July 22, 2025 19:38
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.

Critical Memory Leak: SubgraphNode event listeners never cleaned up on removal
1 participant