Closed NVFedorov closed 4 years ago
Sorry, the arjs-webcam-texture
component needs to have cleanup code added. I will look into fixing this - should be straightforward.
please bear in mind there is an event to be unsubscribed from: https://github.com/AR-js-org/AR.js/blob/11d3225c5e821df46a91f458f80de839f7944c82/aframe/src/location-based/gps-camera.js#L59
Should I file a separate issue for that?
That's a separate thing so I would recommend raising a separate issue: @nicolocarpignoli do you agree?
yep,absolutely, thanks!
created new issue: #172
@NVFedorov have, I believe, fixed #171 on dev branch. Feel free to test and see if it resolves the memory leak.
@nickw1 odd numbers - ar.js with 2 gltf models, even numbers - aframe with forest environment and 1 gltf model.
Did several tests, looks great, thank you!
Do you want to request a feature or report a bug? Bug
What is the current behavior? arjs-webcam-texture component doesn't have remove function to be called on component removal. Video stream is not getting stopped.
If the current behavior is a bug, please provide the steps to reproduce. Add arjs-webcam-texture component to scene and remove it. Video stream is still there.
Please mention other relevant information such as the browser version, Operating System and Device Name Windows 10, chrome Version 85.0.4183.83, PC. What is the expected behavior? Video stream gets stopped and memory gets cleaned. If this is a feature request, what is motivation or use case for changing the behavior?
Background: I'm trying to switch between ar.js and aframe and back and so forth. I noticed that I heap size is increased on every switch.
I tried to clean resources when arjs-webcam-texture is removed the following way:
Also I'm removing event listener registered in
gps-camera
:Here is my scene:
And here is how I create it's content (this code gets invoked on a button click):
So every time I click a button to switch between AR.js and AFrame, the heap size is growing. Or maybe I'm doing something wrong?
P.S.: when I do same manipulations without AR.js the heap size is not growing.