summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/script/script_instance.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp
index f6e51b4d1..2c83e8838 100644
--- a/src/script/script_instance.cpp
+++ b/src/script/script_instance.cpp
@@ -87,7 +87,7 @@ void ScriptInstance::Initialize(const char *main_script, const char *instance_na
}
/* Create the main-class */
- this->instance = MallocT<SQObject>(1);
+ this->instance = new SQObject();
if (!this->engine->CreateClassInstance(instance_name, this->controller, this->instance)) {
this->Died();
return;
@@ -137,7 +137,7 @@ ScriptInstance::~ScriptInstance()
if (engine != nullptr) delete this->engine;
delete this->storage;
delete this->controller;
- free(this->instance);
+ delete this->instance;
}
void ScriptInstance::Continue()