diff --git a/core/src/avm2/object/bytearray_object.rs b/core/src/avm2/object/bytearray_object.rs index e4193f048..c35553682 100644 --- a/core/src/avm2/object/bytearray_object.rs +++ b/core/src/avm2/object/bytearray_object.rs @@ -164,7 +164,7 @@ impl<'gc> TObject<'gc> for ByteArrayObject<'gc> { } unlock!( - Gc::write(activation.context.gc_context, self.0), + Gc::write(activation.gc(), self.0), ByteArrayObjectData, base ) @@ -192,7 +192,7 @@ impl<'gc> TObject<'gc> for ByteArrayObject<'gc> { } unlock!( - Gc::write(activation.context.gc_context, self.0), + Gc::write(activation.gc(), self.0), ByteArrayObjectData, base ) @@ -215,7 +215,7 @@ impl<'gc> TObject<'gc> for ByteArrayObject<'gc> { } Ok(unlock!( - Gc::write(activation.context.gc_context, self.0), + Gc::write(activation.gc(), self.0), ByteArrayObjectData, base ) diff --git a/core/src/avm2/object/error_object.rs b/core/src/avm2/object/error_object.rs index bbd1e02d5..c8d9ddecb 100644 --- a/core/src/avm2/object/error_object.rs +++ b/core/src/avm2/object/error_object.rs @@ -27,10 +27,7 @@ pub fn error_allocator<'gc>( Ok(ErrorObject(Gc::new( activation.context.gc_context, - ErrorObjectData { - base, - call_stack: RefLock::new(call_stack), - }, + ErrorObjectData { base, call_stack }, )) .into()) } @@ -58,7 +55,7 @@ pub struct ErrorObjectData<'gc> { /// Base script object base: RefLock>, - call_stack: RefLock>, + call_stack: CallStack<'gc>, } impl<'gc> ErrorObject<'gc> { @@ -107,8 +104,8 @@ impl<'gc> ErrorObject<'gc> { Ok(output) } - pub fn call_stack(&self) -> Ref> { - self.0.call_stack.borrow() + pub fn call_stack(&self) -> &CallStack<'gc> { + &self.0.call_stack } fn debug_class_name(&self) -> Box { diff --git a/core/src/avm2/object/responder_object.rs b/core/src/avm2/object/responder_object.rs index ca169f0bd..fcc61980b 100644 --- a/core/src/avm2/object/responder_object.rs +++ b/core/src/avm2/object/responder_object.rs @@ -76,8 +76,9 @@ impl<'gc> ResponderObject<'gc> { result: Option>, status: Option>, ) { - unlock!(Gc::write(mc, self.0), ResponderObjectData, result).set(result); - unlock!(Gc::write(mc, self.0), ResponderObjectData, status).set(status); + let write = Gc::write(mc, self.0); + unlock!(write, ResponderObjectData, result).set(result); + unlock!(write, ResponderObjectData, status).set(status); } pub fn send_callback( diff --git a/core/src/avm2/object/xml_list_object.rs b/core/src/avm2/object/xml_list_object.rs index e9448e727..307cf351b 100644 --- a/core/src/avm2/object/xml_list_object.rs +++ b/core/src/avm2/object/xml_list_object.rs @@ -121,11 +121,11 @@ impl<'gc> XmlListObject<'gc> { *unlock!(Gc::write(mc, self.0), XmlListObjectData, children).borrow_mut() = children; } - pub fn target_object(&self) -> Option> { + fn target_object(&self) -> Option> { self.0.target_object.get() } - pub fn target_property(&self) -> Option> { + fn target_property(&self) -> Option> { self.0.target_property.borrow().clone() }