summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-11-08 12:28:57 +0000
committerpeter1138 <peter1138@openttd.org>2006-11-08 12:28:57 +0000
commit2c17c649afd9f199f571c83407820e53b5f52c7c (patch)
tree6b12f0d8bf49b2d7b44c19526b92869086c8fb67
parent0aa8c0123a827e6aa74dc9f88824aa810a1e1df9 (diff)
downloadopenttd-2c17c649afd9f199f571c83407820e53b5f52c7c.tar.xz
(svn r7114) -Codechange: [NewStations] Free up custom station layouts
-rw-r--r--newgrf.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/newgrf.c b/newgrf.c
index 7a50859f0..3277d9a95 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -3165,7 +3165,18 @@ static void ResetCustomStations(void)
free(statspec->renderdata);
}
- // TODO: Release platforms and layouts
+ /* Release platforms and layouts */
+ if (!statspec->copied_layouts) {
+ uint l, p;
+ for (l = 0; l < statspec->lengths; l++) {
+ for (p = 0; p < statspec->platforms[l]; p++) {
+ free(statspec->layouts[l][p]);
+ }
+ free(statspec->layouts[l]);
+ }
+ free(statspec->layouts);
+ free(statspec->platforms);
+ }
/* Release this station */
free(statspec);