forked from mirror/OpenTTD
(svn r10799) -Fix: only calling QuickFree and not the destructor on pool cleanups might cause memory leaks due to the way C++ works.
This commit is contained in:
@@ -53,6 +53,10 @@ Town::Town(TileIndex tile)
|
||||
|
||||
Town::~Town()
|
||||
{
|
||||
DeleteName(this->townnametype);
|
||||
|
||||
if (CleaningPool()) return;
|
||||
|
||||
Industry *i;
|
||||
|
||||
/* Delete town authority window
|
||||
@@ -87,15 +91,9 @@ Town::~Town()
|
||||
|
||||
MarkWholeScreenDirty();
|
||||
|
||||
this->QuickFree();
|
||||
this->xy = 0;
|
||||
}
|
||||
|
||||
void Town::QuickFree()
|
||||
{
|
||||
DeleteName(this->townnametype);
|
||||
}
|
||||
|
||||
// Local
|
||||
static int _grow_town_result;
|
||||
|
||||
|
Reference in New Issue
Block a user