From 581d1070b4f96bdcf191b4f6d397475d189bc9e0 Mon Sep 17 00:00:00 2001 From: alberth Date: Sat, 2 Oct 2010 09:46:40 +0000 Subject: (svn r20862) -Codechange: Make AyStar_Free() a method. --- src/pathfinder/npf/aystar.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/pathfinder/npf/aystar.cpp') diff --git a/src/pathfinder/npf/aystar.cpp b/src/pathfinder/npf/aystar.cpp index 150b86b56..0895a0845 100644 --- a/src/pathfinder/npf/aystar.cpp +++ b/src/pathfinder/npf/aystar.cpp @@ -198,13 +198,13 @@ static int AyStarMain_Loop(AyStar *aystar) /* * This function frees the memory it allocated */ -static void AyStarMain_Free(AyStar *aystar) +void AyStar::Free() { - aystar->OpenListQueue.Free(false); + this->OpenListQueue.Free(false); /* 2nd argument above is false, below is true, to free the values only * once */ - delete_Hash(&aystar->OpenListHash, true); - delete_Hash(&aystar->ClosedListHash, true); + delete_Hash(&this->OpenListHash, true); + delete_Hash(&this->ClosedListHash, true); #ifdef AYSTAR_DEBUG printf("[AyStar] Memory free'd\n"); #endif @@ -296,7 +296,6 @@ void init_AyStar(AyStar *aystar, Hash_HashProc hash, uint num_buckets) aystar->addstart = AyStarMain_AddStartNode; aystar->main = AyStarMain_Main; aystar->loop = AyStarMain_Loop; - aystar->free = AyStarMain_Free; aystar->clear = AyStarMain_Clear; aystar->checktile = AyStarMain_CheckTile; } -- cgit v1.2.3-54-g00ecf