Pārlūkot izejas kodu

fixed memory leak

mateuszb 17 gadi atpakaļ
vecāks
revīzija
7bb67cd711
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1 0
      CAdvmapInterface.cpp

+ 1 - 0
CAdvmapInterface.cpp

@@ -315,6 +315,7 @@ void CTerrainRect::clickLeft(tribool down)
 		//Convert to old format.
 		//Convert to old format.
 		currentPath = LOCPLINT->adventureInt->heroList.items[LOCPLINT->adventureInt->heroList.selected].second = CGI->pathf->ConvertToOldFormat(p);
 		currentPath = LOCPLINT->adventureInt->heroList.items[LOCPLINT->adventureInt->heroList.selected].second = CGI->pathf->ConvertToOldFormat(p);
 
 
+		delete p;
 		//currentPath = LOCPLINT->adventureInt->heroList.items[LOCPLINT->adventureInt->heroList.selected].second = CGI->pathf->getPath(bufpos,mp,currentHero,1);
 		//currentPath = LOCPLINT->adventureInt->heroList.items[LOCPLINT->adventureInt->heroList.selected].second = CGI->pathf->getPath(bufpos,mp,currentHero,1);
 	}
 	}
 }
 }