(svn r7237) -Fix: TGP landscape generation could leak memory if aborted during the generation of the heightmap.
This commit is contained in:
3
tgp.c
3
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user