From 96cbd594a0231c9d5cff208e773e8ab0926ad6d1 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 14 Apr 2021 19:29:42 +0200 Subject: [PATCH] Better handling of clearning scripts. Signed-off-by: Deukhoofd --- src/Battling/ScriptHandling/ScriptSet.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Battling/ScriptHandling/ScriptSet.hpp b/src/Battling/ScriptHandling/ScriptSet.hpp index 2872369..25a0aed 100644 --- a/src/Battling/ScriptHandling/ScriptSet.hpp +++ b/src/Battling/ScriptHandling/ScriptSet.hpp @@ -61,8 +61,8 @@ namespace CreatureLib::Battling { void Clear() { for (auto s : _scripts) { s->OnRemove(); - delete s; } + _scripts.Clear(); _lookup.Clear(); }