1
0
Fork 0

Codechange: new instead of malloc

pull/7837/head
Charles Pigott 2019-11-02 12:44:33 +00:00 committed by Niels Martin Hansen
parent ddffe32f15
commit cf354f6668
1 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ void ScriptInstance::Initialize(const char *main_script, const char *instance_na
} }
/* Create the main-class */ /* Create the main-class */
this->instance = MallocT<SQObject>(1); this->instance = new SQObject();
if (!this->engine->CreateClassInstance(instance_name, this->controller, this->instance)) { if (!this->engine->CreateClassInstance(instance_name, this->controller, this->instance)) {
this->Died(); this->Died();
return; return;
@ -137,7 +137,7 @@ ScriptInstance::~ScriptInstance()
if (engine != nullptr) delete this->engine; if (engine != nullptr) delete this->engine;
delete this->storage; delete this->storage;
delete this->controller; delete this->controller;
free(this->instance); delete this->instance;
} }
void ScriptInstance::Continue() void ScriptInstance::Continue()