From ce023bea246ed0d8782523a5fe2767f37db6422d Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 29 May 2023 00:47:31 -0400 Subject: [PATCH] Don't root a Realm that's used for one call. --- components/script/dom/bindings/interface.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/script/dom/bindings/interface.rs b/components/script/dom/bindings/interface.rs index 6fa7591b41b..d3f77356b08 100644 --- a/components/script/dom/bindings/interface.rs +++ b/components/script/dom/bindings/interface.rs @@ -686,14 +686,14 @@ pub fn get_desired_proto( // Fall back to getting the proto for our given proto id in the realm that // GetFunctionRealm(newTarget) returns. - rooted!(in(*cx) let realm = GetFunctionRealm(*cx, new_target.handle().into())); + let realm = GetFunctionRealm(*cx, new_target.handle().into()); - if (*realm).is_null() { + if realm.is_null() { return Err(()); } { - let _realm = JSAutoRealm::new(*cx, GetRealmGlobalOrNull(*realm)); + let _realm = JSAutoRealm::new(*cx, GetRealmGlobalOrNull(realm)); rooted!(in(*cx) let global = CurrentGlobalOrNull(*cx)); get_per_interface_object_handle( cx,