aframevr / aframevr/aframe

Not cleaning up after scene removal

Open
#3,463 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

A-frame is not cleaning up after itself when it is removed from the DOM. And as far as I can tell there is no API to destroy the scene manually?

I'm using an embeded a-frame scene in a nuxtjs spa and have noticed when I navigate to different page components the requestAnimationFrame continues to fire (there's also a memory leak I can't figure out but that is a separate issue).

Wait 2 seconds then record the performance in dev tools - you can see the raf.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Glitch reproduction and navigate between Nuxt page components while recording Chrome DevTools performance data. Inspect the scene-removal lifecycle and the requestAnimationFrame that continues after DOM removal; done should mean the RAF stops when the scene is removed and the issue's requested manual destruction path is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nuxtjs
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.