-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Description
Description
I am going to prefix this with a "I may be wasting your time".
I don't have a direct way to observe if this is a memory leak or not as my Meta Quest browser doesn't have debugging.
But in WebXRManager setSession the internal session is overwritten and the new one has all the events added to it.
But, if you were to call setSession again before endSession event triggers, either with a new session or a null, it becomes impossible to remove the event listeners.
I can understand this is by far not a priority, and any booboos this causes is all at the fault of the developer calling setSession twice..
I just happened to spot it as a potential problem and wanted to highlight it.
If it's deemed as not a problem then I will know not to highlight any other similar issues I may spot in the future when looking through the code.
Reproduction steps
const session = await navigator.xr?.offerSession('immersive-ar', {
requiredFeatures: ['local'],
});
renderer.xr.setReferenceSpaceType('local');
await renderer.xr.setSession(session);
await renderer.xr.setSession(null);Code
const session = await navigator.xr?.offerSession('immersive-ar', {
requiredFeatures: ['local'],
});
renderer.xr.setReferenceSpaceType('local');
await renderer.xr.setSession(session);
await renderer.xr.setSession(null);Live example
- jsfiddle-latest-release WebGLRenderer
- jsfiddle-dev WebGLRenderer
- jsfiddle-latest-release WebGPURenderer
- jsfiddle-dev WebGPURenderer
Screenshots
No response
Version
176
Device
Headset
Browser
Quest Browser
OS
Linux