Skip to content

fix: lose unused WebGL context after Canvas destroy #1888

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
May 26, 2025

Conversation

DhivinX
Copy link
Collaborator

@DhivinX DhivinX commented May 26, 2025

This PR fix memory leak by explicitly releasing unused WebGL contexts when the canvas element is destroyed.

Why?
Because unused WebGL contexts can continue consuming GPU resources even after the canvas element has been removed from the DOM. Without explicitly releasing these contexts, this leads to memory leaks and increased GPU resource usage, potentially degrading application performance and stability over time.

This fix ensures that WebGL contexts are properly released when the canvas element is destroyed, preventing GPU memory leaks.

@DhivinX DhivinX requested a review from xeolabs May 26, 2025 11:09
@xeolabs xeolabs merged commit c82f011 into xeokit:master May 26, 2025
1 check passed
@DhivinX DhivinX deleted the fix/lose-context branch June 2, 2025 12:09
@DhivinX DhivinX restored the fix/lose-context branch June 2, 2025 12:30
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