aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/vrpose.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/vrpose.rs')
-rw-r--r--components/script/dom/vrpose.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/components/script/dom/vrpose.rs b/components/script/dom/vrpose.rs
index 542059ca799..ee035e2a0f1 100644
--- a/components/script/dom/vrpose.rs
+++ b/components/script/dom/vrpose.rs
@@ -32,7 +32,9 @@ unsafe fn update_or_create_typed_array(cx: *mut JSContext,
match src {
Some(data) => {
if dst.get().is_null() {
- let _ = Float32Array::create(cx, CreateWith::Slice(data), dst.handle_mut());
+ rooted!(in (cx) let mut array = ptr::null_mut());
+ let _ = Float32Array::create(cx, CreateWith::Slice(data), array.handle_mut());
+ (*dst).set(array.get());
} else {
typedarray!(in(cx) let array: Float32Array = dst.get());
if let Ok(mut array) = array {