1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-24 15:09:10 +00:00

Fix #7988: Memory leak when using custom depot names

This commit is contained in:
Charles Pigott
2020-02-09 11:44:45 +00:00
parent 887dce4655
commit 49d2a07f66

View File

@@ -27,6 +27,8 @@ INSTANTIATE_POOL_METHODS(Depot)
*/
Depot::~Depot()
{
free(this->name);
if (CleaningPool()) return;
if (!IsDepotTile(this->xy) || GetDepotIndex(this->xy) != this->index) {