aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api')
-rw-r--r--src/crepe/api/BehaviorScript.cpp8
-rw-r--r--src/crepe/api/BehaviorScript.h2
2 files changed, 9 insertions, 1 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;
+ }
+}
+
diff --git a/src/crepe/api/BehaviorScript.h b/src/crepe/api/BehaviorScript.h
index 052d764..e197991 100644
--- a/src/crepe/api/BehaviorScript.h
+++ b/src/crepe/api/BehaviorScript.h
@@ -16,7 +16,7 @@ protected:
friend class crepe::ComponentManager;
BehaviorScript();
public:
- virtual ~BehaviorScript() = default;
+ virtual ~BehaviorScript();
public:
template<class T>