1
0
Fork 0

(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.

release/0.6
rubidium 2007-06-27 17:05:06 +00:00
parent ffffde515f
commit 3c5622ee9a
1 changed files with 7 additions and 1 deletions

View File

@ -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;