mirror of https://github.com/OpenTTD/OpenTTD
Codechange: new instead of malloc
parent
ddffe32f15
commit
cf354f6668
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue