(svn r7114) -Codechange: [NewStations] Free up custom station layouts
authorpeter1138
Wed, 08 Nov 2006 12:28:57 +0000
changeset 5061 cb097749d18f
parent 5060 2d577061b0ec
child 5062 7c341b020f5f
(svn r7114) -Codechange: [NewStations] Free up custom station layouts
newgrf.c
--- a/newgrf.c	Wed Nov 08 12:17:14 2006 +0000
+++ b/newgrf.c	Wed Nov 08 12:28:57 2006 +0000
@@ -3165,7 +3165,18 @@
 				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);