Hopefully fixes the issue with ref counting in angelscript
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
e18767995c
commit
4a8b3e13a1
|
@ -187,6 +187,7 @@ CreatureLib::Battling::BattleScript* AngelScriptResolver::LoadScript(const ArbUt
|
|||
}
|
||||
auto ctx = _contextPool->RequestContext();
|
||||
auto obj = const_cast<AngelScriptTypeInfo*>(t.value().get())->Instantiate(ctx);
|
||||
obj->AddRef();
|
||||
_contextPool->ReturnContextToPool(ctx);
|
||||
auto ownerType = GetScriptOwnerType(category);
|
||||
return new AngelScriptScript(owner, ownerType, this, t.value(), obj, _contextPool);
|
||||
|
|
|
@ -34,6 +34,7 @@ CreatureLib::Battling::BattleScript* AngelScriptScript::Clone(const ArbUt::Optio
|
|||
if (_obj != nullptr) {
|
||||
obj->CopyFrom(_obj);
|
||||
}
|
||||
obj->AddRef();
|
||||
_ctxPool->ReturnContextToPool(ctx);
|
||||
|
||||
return new AngelScriptScript(owner, GetAngelscriptOwner()->GetType(), _resolver, _type, obj, _ctxPool);
|
||||
|
|
|
@ -61,7 +61,6 @@ public:
|
|||
throw ArbUt::Exception("Instantiation failed.");
|
||||
}
|
||||
asIScriptObject* obj = *(asIScriptObject**)ctx->GetAddressOfReturnValue();
|
||||
obj->AddRef();
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue