- Fixed: FreshThinkers's max. index is MAX_STATNUM so the code shouldn't

to access FreshThinkers[MAX_STATNUM+1].


SVN r808 (trunk)
This commit is contained in:
Christoph Oelckers 2008-03-16 20:57:46 +00:00
parent 3c6c60c730
commit 0aadfeb3c7
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,7 @@
March 16, 2008 (Changes by Graf Zahl)
- Fixed: FreshThinkers's max. index is MAX_STATNUM so the code shouldn't
to access FreshThinkers[MAX_STATNUM+1].
March 15, 2008
- Fixed: The only time bestslideline is ever NULL is before it ever gets set.
That means my P_BounceWall() from March 6 wasn't really correct.

View file

@ -309,11 +309,12 @@ void DThinker::ChangeStatNum (int statnum)
// Mark the first thinker of each list
void DThinker::MarkRoots()
{
for (int i = 0; i <= MAX_STATNUM+1; ++i)
for (int i = 0; i <= MAX_STATNUM; ++i)
{
GC::Mark(Thinkers[i].Sentinel);
GC::Mark(FreshThinkers[i].Sentinel);
}
GC::Mark(Thinkers[MAX_STATNUM+1].Sentinel);
}
// Destroy every thinker
@ -321,7 +322,7 @@ void DThinker::DestroyAllThinkers ()
{
int i;
for (i = 0; i <= MAX_STATNUM+1; i++)
for (i = 0; i <= MAX_STATNUM; i++)
{
if (i != STAT_TRAVELLING)
{
@ -329,6 +330,7 @@ void DThinker::DestroyAllThinkers ()
DestroyThinkersInList (FreshThinkers[i]);
}
}
DestroyThinkersInList (Thinkers[MAX_STATNUM+1]);
GC::FullGC();
}