From cf358c75a41f979666db3139513a64ae204d9118 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 26 Feb 2022 20:53:28 +0100 Subject: [PATCH] Fix(?) strange behaviour in angelcode clone --- src/ScriptResolving/AngelScript/AngelScriptScript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScriptResolving/AngelScript/AngelScriptScript.cpp b/src/ScriptResolving/AngelScript/AngelScriptScript.cpp index a3bb0ca..e16ab76 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptScript.cpp +++ b/src/ScriptResolving/AngelScript/AngelScriptScript.cpp @@ -24,7 +24,6 @@ AngelScriptScript::AngelScriptScript(const ArbUt::OptionalBorrowedPtr& own THROW("Script was created with owner value, but with unknown owner type.") } auto* handle = GetAngelscriptOwner(); - handle->ReleaseReferences(resolver->GetEngine()); handle->Set(owner.GetValue(), ownerType); } } @@ -368,6 +367,7 @@ CreatureLib::Battling::BattleScript* AngelScriptScript::Clone(const ArbUt::Optio auto* ctx = _ctxPool->RequestContext(); auto* obj = _type->Instantiate(ctx); if (_obj != nullptr) { + obj->Release(); obj->CopyFrom(_obj); } _ctxPool->ReturnContextToPool(ctx);