Avoid accessing DOM global from XR's destructor.

This commit is contained in:
Josh Matthews 2019-12-19 18:14:49 -05:00
parent fda0572a93
commit 3e95efdea6
2 changed files with 21 additions and 15 deletions

View file

@ -184,7 +184,8 @@ impl NavigatorMethods for Navigator {
/// https://immersive-web.github.io/webxr/#dom-navigator-xr
fn Xr(&self) -> DomRoot<XRSystem> {
self.xr.or_init(|| XRSystem::new(&self.global()))
self.xr
.or_init(|| XRSystem::new(&self.global().as_window()))
}
/// https://w3c.github.io/mediacapture-main/#dom-navigator-mediadevices