BabylonReactNative
BabylonReactNative copied to clipboard
Playground crashes if XR is toggled off when the engine view is already toggled off
trafficstars
Repro:
- Run the Playground app
- Tap Start XR
- Tap Toggle EngineView
- Tap Stop XR
One of two things will happen:
- (Usually) Nothing seems to happen at first, but if you tap either Toggle EngineView or Stop XR (again), it will crash
- (Sometimes) It will just hang and become unresponsive
I have a partial fix for this with https://github.com/BabylonJS/BabylonNative/pull/746 which will address the hang that sometimes happens when toggling off the engine view while in XR.
This isn't necessarily the proper fix though. I haven't figured out why the code is continuing to render after the Android surface is destroyed. Ideally, XR should stop rendering completely when the window is set to null.
The partial fix caused a regression https://github.com/BabylonJS/BabylonNative/issues/755. Need to make sure to check all XR scenarios for future fixes.