From b0861ce0fb5cc7877cd099809e76f0847b55aa02 Mon Sep 17 00:00:00 2001 From: Kenneth Loeffler Date: Sun, 9 Jul 2023 23:11:26 -0700 Subject: [PATCH] Use a read lock in clone_into_external_dom (#64) --- packages/lib-roblox/src/instance/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lib-roblox/src/instance/mod.rs b/packages/lib-roblox/src/instance/mod.rs index 87675b9..9b095d4 100644 --- a/packages/lib-roblox/src/instance/mod.rs +++ b/packages/lib-roblox/src/instance/mod.rs @@ -141,8 +141,8 @@ impl Instance { */ pub fn clone_into_external_dom(self, external_dom: &mut WeakDom) -> DomRef { let dom = INTERNAL_DOM - .try_write() - .expect("Failed to get write access to document"); + .try_read() + .expect("Failed to get read access to document"); let cloned = dom.clone_into_external(self.dom_ref, external_dom); external_dom.transfer_within(cloned, external_dom.root_ref());