Skip to content

[FIX] Fix duplicate XrViews instance and clean up handler in XrManager#8392

Merged
willeastcott merged 1 commit intomainfrom
xrmanager-fixes
Jan 20, 2026
Merged

[FIX] Fix duplicate XrViews instance and clean up handler in XrManager#8392
willeastcott merged 1 commit intomainfrom
xrmanager-fixes

Conversation

@willeastcott
Copy link
Contributor

@willeastcott willeastcott commented Jan 20, 2026

Summary

  • Remove duplicate XrViews instantiation in constructor that was accidentally introduced in WebXR Depth Camera #5848, causing memory leak
  • Fix frameratechange event listener never being removed when XR session ends
  • Fix incorrect JSDoc comment in end() method that said "started" instead of "ended"

Checklist

  • I have read the contributing guidelines
  • My code follows the project's coding standards
  • This PR focuses on a single change

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes three issues in the XrManager class: a duplicate XrViews instantiation that caused a memory leak, a missing cleanup handler for the 'frameratechange' event listener, and an incorrect JSDoc comment.

Changes:

  • Removed duplicate XrViews instantiation in constructor (line 307)
  • Refactored frameratechange event listener to use a named function onFrameRateChange that can be properly cleaned up
  • Corrected JSDoc comment in end() method to say "ended" instead of "started"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@willeastcott willeastcott merged commit e8c3af8 into main Jan 20, 2026
13 checks passed
@willeastcott willeastcott deleted the xrmanager-fixes branch January 20, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: xr XR related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant