summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2019-11-02 12:44:33 +0000
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-11-15 21:06:09 +0100
commitcf354f666804c67dfb7ddfeceda4a6306acdb09e (patch)
tree23edc6d769072ce04bb4c318f4d9679df1b26d19
parentddffe32f15807e3ff1baf91b4242951e4ab4e7b5 (diff)
downloadopenttd-cf354f666804c67dfb7ddfeceda4a6306acdb09e.tar.xz
Codechange: new instead of malloc
-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()