From bc6b348e7a67b758fd4de5268941226380e5be24 Mon Sep 17 00:00:00 2001 From: frosch Date: Tue, 17 May 2011 20:11:19 +0000 Subject: (svn r22472) -Fix: When a NewGRF assigned station properties 09 and/or 0A multiple times, the previously allocated sprite layouts were not freed. --- src/newgrf.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index f5acb8625..51002f721 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1221,6 +1221,8 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte } case 0x09: // Define sprite layout + delete[] statspec->renderdata; // delete earlier loaded stuff + statspec->tiles = buf->ReadExtendedByte(); statspec->renderdata = new NewGRFSpriteLayout[statspec->tiles]; @@ -1281,6 +1283,8 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte continue; } + delete[] statspec->renderdata; // delete earlier loaded stuff + statspec->tiles = srcstatspec->tiles; statspec->renderdata = new NewGRFSpriteLayout[statspec->tiles]; for (uint t = 0; t < statspec->tiles; t++) { -- cgit v1.2.3-70-g09d2