(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:
rubidium
2007-08-05 21:20:55 +00:00
parent dfe851e02f
commit 8f719a7b2d
15 changed files with 48 additions and 67 deletions

View File

@@ -64,6 +64,11 @@ Station::~Station()
{
DEBUG(station, cDebugCtorLevel, "I-%3d", index);
DeleteName(this->string_id);
free(this->speclist);
if (CleaningPool()) return;
MarkDirty();
RebuildStationLists();
InvalidateWindowClasses(WC_STATION_LIST);
@@ -81,14 +86,6 @@ Station::~Station()
for (CargoID c = 0; c < NUM_CARGO; c++) {
goods[c].cargo.Truncate(0);
}
this->QuickFree();
}
void Station::QuickFree()
{
DeleteName(this->string_id);
free(this->speclist);
}
/** Called when new facility is built on the station. If it is the first facility