mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-12 09:38:28 +00:00
(svn r15124) -Fix: last memory leak related to NoAI
This commit is contained in:
parent
3abb8abd07
commit
4bc7afae41
@ -148,6 +148,7 @@ AIInstance::AIInstance(AIInfo *info) :
|
|||||||
|
|
||||||
AIInstance::~AIInstance()
|
AIInstance::~AIInstance()
|
||||||
{
|
{
|
||||||
|
if (instance != NULL) this->engine->ReleaseObject(this->instance);
|
||||||
if (engine != NULL) delete this->engine;
|
if (engine != NULL) delete this->engine;
|
||||||
delete this->storage;
|
delete this->storage;
|
||||||
delete this->controller;
|
delete this->controller;
|
||||||
@ -246,7 +247,9 @@ void AIInstance::Died()
|
|||||||
DEBUG(ai, 0, "The AI died unexpectedly.");
|
DEBUG(ai, 0, "The AI died unexpectedly.");
|
||||||
this->is_dead = true;
|
this->is_dead = true;
|
||||||
|
|
||||||
|
this->engine->ReleaseObject(this->instance);
|
||||||
delete this->engine;
|
delete this->engine;
|
||||||
|
this->instance = NULL;
|
||||||
this->engine = NULL;
|
this->engine = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user