summaryrefslogtreecommitdiff
path: root/src/npf.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-27 17:05:06 +0000
committerrubidium <rubidium@openttd.org>2007-06-27 17:05:06 +0000
commit0ab80d824b9f1935871eb165961900c368216ad3 (patch)
tree51be32d68b897e6d6b9d2e6c52db190cc0a9886e /src/npf.cpp
parent43a85ee94fc2d8459161ccd0d1e8108e4c3888b9 (diff)
downloadopenttd-0ab80d824b9f1935871eb165961900c368216ad3.tar.xz
(svn r10357) -Fix: and when we're at it... yet another memory leak, but only when you start a new game; can't find any other memory leaks we can fix.
Diffstat (limited to 'src/npf.cpp')
-rw-r--r--src/npf.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/npf.cpp b/src/npf.cpp
index 10e4b6171..5f7fce75c 100644
--- a/src/npf.cpp
+++ b/src/npf.cpp
@@ -877,7 +877,13 @@ NPFFoundTargetData NPFRouteToDepotTrialError(TileIndex tile, Trackdir trackdir,
void InitializeNPF()
{
- init_AyStar(&_npf_aystar, NPFHash, NPF_HASH_SIZE);
+ static bool first_init = true;
+ if (first_init) {
+ first_init = false;
+ init_AyStar(&_npf_aystar, NPFHash, NPF_HASH_SIZE);
+ } else {
+ AyStarMain_Clear(&_npf_aystar);
+ }
_npf_aystar.loops_per_tick = 0;
_npf_aystar.max_path_cost = 0;
//_npf_aystar.max_search_nodes = 0;