-
Notifications
You must be signed in to change notification settings - Fork 105
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
How do you dispose of the engine? #65
Comments
Good catch - above commit should resolve and dispose automatically. You could dispose yourself by getting the Engine from the context and something like a |
I had tried something like that but I seem to keep getting a null value back for the Engine object. Do you have an example of how you would see this workaround working? |
You can do scene.getEngine() or get engine from context before Scene component (inside Engine). Inside Scene component is where the reconciler overwrites the context. It’s a bit tricky how React resets context Inside the reconciler. Engine will be disposed automatically when the Engine component unmounts in the code fix :) |
…ed an additional check before disposing the Scene #65
Should be fixed in |
Hi,
I'm looking for a way to dispose of the engine once my component containing it unmounts. I thought this might be done by default but it looks like it's not. Is there anyway to access the engine object from say a useEffect hook in the component the engine is declared in?
The text was updated successfully, but these errors were encountered: