avm2: Fix function double borrow panic

This commit is contained in:
EmperorBale 2023-03-18 15:59:36 -07:00 committed by Mike Welsh
parent 53d9118834
commit 7a4a4f7c9a
1 changed files with 4 additions and 4 deletions

View File

@ -181,10 +181,10 @@ impl<'gc> TObject<'gc> for FunctionObject<'gc> {
arguments: &[Value<'gc>], arguments: &[Value<'gc>],
activation: &mut Activation<'_, 'gc>, activation: &mut Activation<'_, 'gc>,
) -> Result<Value<'gc>, Error<'gc>> { ) -> Result<Value<'gc>, Error<'gc>> {
self.0 // NOTE: Cloning an executable does not allocate new memory
.read() let exec = self.0.read().exec.clone();
.exec
.exec(receiver, arguments, activation, self.into()) exec.exec(receiver, arguments, activation, self.into())
} }
fn construct( fn construct(