diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2019-11-02 12:44:33 +0000 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-11-15 21:06:09 +0100 |
commit | cf354f666804c67dfb7ddfeceda4a6306acdb09e (patch) | |
tree | 23edc6d769072ce04bb4c318f4d9679df1b26d19 /src | |
parent | ddffe32f15807e3ff1baf91b4242951e4ab4e7b5 (diff) | |
download | openttd-cf354f666804c67dfb7ddfeceda4a6306acdb09e.tar.xz |
Codechange: new instead of malloc
Diffstat (limited to 'src')
-rw-r--r-- | src/script/script_instance.cpp | 4 |
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() |