TINSEL: Fix a leak in DW2, and a potential OOB in NextTaggedActor

svn-id: r54029
This commit is contained in:
Max Horn 2010-11-01 21:06:04 +00:00
parent 7f1a9699fa
commit 9cadcf4c5b
2 changed files with 7 additions and 1 deletions

View File

@ -199,6 +199,10 @@ void RegisterActors(int num) {
void FreeActors() {
free(actorInfo);
actorInfo = NULL;
if (TinselV2) {
free(zFactors);
zFactors = NULL;
}
}
/**
@ -625,7 +629,7 @@ int NextTaggedActor() {
PMOVER pActor;
bool hid;
do {
while (ti < NumActors); {
if (actorInfo[ti].tagged) {
pActor = GetMover(ti+1);
if (pActor)
@ -637,6 +641,7 @@ int NextTaggedActor() {
return ++ti;
}
}
++ti;
} while (++ti < NumActors);
return 0;

View File

@ -760,6 +760,7 @@ void GlobalProcesses(uint32 numProcess, byte *pProcess) {
*/
void FreeGlobalProcesses() {
delete[] pGlobalProcess;
pGlobalProcess = 0;
numGlobalProcess = 0;
}