Fixes several potential leaks
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
a4471ec5b1
commit
727aab37d7
|
@ -12,8 +12,7 @@ export_func u8 CreatureLib_ExecutingAttack_Construct(ExecutingAttack*& out, Crea
|
||||||
for (size_t i = 0; i < targetCount; i++) {
|
for (size_t i = 0; i < targetCount; i++) {
|
||||||
ls.Append(targets[i]);
|
ls.Append(targets[i]);
|
||||||
}
|
}
|
||||||
auto s = ArbUt::OptionalUniquePtr<BattleScript>(script);
|
out = new ExecutingAttack(ls, numberHits, user, attack, attackData, script);
|
||||||
out = new ExecutingAttack(ls, numberHits, user, attack, attackData, s);
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,5 +16,5 @@ export_func u8 CreatureLib_ScriptResolver_LoadScript(BattleScript*& out, ScriptR
|
||||||
|
|
||||||
export_func u8 CreatureLib_ScriptResolver_LoadItemScript(ItemUseScript*& out, ScriptResolver* p,
|
export_func u8 CreatureLib_ScriptResolver_LoadItemScript(ItemUseScript*& out, ScriptResolver* p,
|
||||||
const CreatureLib::Library::Item* item) {
|
const CreatureLib::Library::Item* item) {
|
||||||
Try(out = p->LoadItemScript(item);)
|
Try(out = p->LoadItemScript(item).TakeOwnership();)
|
||||||
};
|
};
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace CreatureLib::Battling {
|
||||||
auto& current = _scripts[_index];
|
auto& current = _scripts[_index];
|
||||||
if (!current.IsSet()) {
|
if (!current.IsSet()) {
|
||||||
auto s = current.GetScript();
|
auto s = current.GetScript();
|
||||||
out = *s;
|
out = s->GetValue();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
auto& set = current.GetScriptSet()->GetIterator();
|
auto& set = current.GetScriptSet()->GetIterator();
|
||||||
|
|
Loading…
Reference in New Issue