summaryrefslogtreecommitdiff
path: root/tgp.c
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-11-22 14:14:02 +0000
committerrubidium <rubidium@openttd.org>2006-11-22 14:14:02 +0000
commit3919198e4d58c79e63d77fad6758cd140b925c5c (patch)
treed4299b13a2cc853b6b7727f8018c72cebcced034 /tgp.c
parent62c13013a593d4b6b485b34c3bd39e19cd7666e0 (diff)
downloadopenttd-3919198e4d58c79e63d77fad6758cd140b925c5c.tar.xz
(svn r7237) -Fix: TGP landscape generation could leak memory if aborted during the generation of the heightmap.
Diffstat (limited to 'tgp.c')
-rw-r--r--tgp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tgp.c b/tgp.c
index 8c99856f6..d7f9722f9 100644
--- a/tgp.c
+++ b/tgp.c
@@ -798,6 +798,8 @@ void GenerateTerrainPerlin(void)
uint x, y;
if (!AllocHeightMap()) return;
+ GenerateWorldSetAbortCallback(FreeHeightMap);
+
HeightMapGenerate();
IncreaseGeneratingWorldProgress(GWP_LANDSCAPE);
@@ -823,4 +825,5 @@ void GenerateTerrainPerlin(void)
for (x = 0; x < _height_map.size_x; x++) MakeVoid(_height_map.size_x * y + x);
FreeHeightMap();
+ GenerateWorldSetAbortCallback(NULL);
}