mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-13 02:52:37 +00:00
Codechange: new instead of malloc
This commit is contained in:
parent
ddffe32f15
commit
cf354f6668
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user