aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/BehaviorScript.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-16 17:28:15 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-16 17:28:15 +0200
commit81a9b43e12a32340262fa0e74005c7e6bd25eba7 (patch)
tree9677122d27752f839407a8cd11feea87a1d4110e /src/crepe/api/BehaviorScript.cpp
parent1f82ffa4d3ee8355215d43bf43edf8cecaca0d1d (diff)
properly clean up Script instance
Diffstat (limited to 'src/crepe/api/BehaviorScript.cpp')
-rw-r--r--src/crepe/api/BehaviorScript.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/crepe/api/BehaviorScript.cpp b/src/crepe/api/BehaviorScript.cpp
index 2dd933e..e8a85dd 100644
--- a/src/crepe/api/BehaviorScript.cpp
+++ b/src/crepe/api/BehaviorScript.cpp
@@ -1,5 +1,6 @@
#include "../util/log.h"
+#include "Script.h"
#include "BehaviorScript.h"
using namespace crepe::api;
@@ -8,3 +9,10 @@ BehaviorScript::BehaviorScript() {
dbg_trace();
}
+BehaviorScript::~BehaviorScript() {
+ if (this->script != nullptr) {
+ delete this->script;
+ this->script = nullptr;
+ }
+}
+