From cf354f666804c67dfb7ddfeceda4a6306acdb09e Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sat, 2 Nov 2019 12:44:33 +0000 Subject: Codechange: new instead of malloc --- src/script/script_instance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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(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() -- cgit v1.2.3-70-g09d2