a
This commit is contained in:
1 parent
c6824a6748
commit
ed87d759e0
1 file changed
+10
-21
+10
-21
@@ -248,28 +248,20 @@ void P_RemoveThinkerDelayed(thinker_t *thinker)
|
||||
else if (thinker->references) // Usually gets cleared up in one frame; what's going on here, then?
|
||||
CONS_Printf("Number of potentially faulty references: %d\n", thinker->references);
|
||||
#endif
|
||||
if (thinker->references)
|
||||
|
||||
if (thinker->references != 0)
|
||||
return;
|
||||
|
||||
/* Remove from main thinker list */
|
||||
thinker_t *next = thinker->next;
|
||||
/* Note that currentthinker is guaranteed to point to us,
|
||||
* and since we're freeing our memory, we had better change that. So
|
||||
* point it to thinker->prev, so the iterator will correctly move on to
|
||||
* thinker->prev->next = thinker->next */
|
||||
(next->prev = currentthinker = thinker->prev)->next = next;
|
||||
R_DestroyLevelInterpolators(thinker);
|
||||
|
||||
if (thinker->cachable == true)
|
||||
{
|
||||
// put cachable thinkers in the mobj cache, so we can avoid allocations
|
||||
((mobj_t *)thinker)->hnext = mobjcache;
|
||||
mobjcache = (mobj_t *)thinker;
|
||||
}
|
||||
else
|
||||
{
|
||||
Z_Free(thinker);
|
||||
}
|
||||
/* Note that currentthinker is guaranteed to point to us,
|
||||
* and since we're freeing our memory, we had better change that. So
|
||||
* point it to thinker->prev, so the iterator will correctly move on to
|
||||
* thinker->prev->next = thinker->next */
|
||||
currentthinker = thinker->prev;
|
||||
|
||||
/* Remove from main thinker list */
|
||||
P_UnlinkThinker(thinker);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -285,9 +277,6 @@ void P_UnlinkThinker(thinker_t *thinker)
|
||||
|
||||
(next->prev = thinker->prev)->next = next;
|
||||
|
||||
//if (thinker->cachable != true && thinker->cachable != false)
|
||||
//CONS_Alert(CONS_ERROR, "P_UnlinkThinker: weird value for cachable = %d\n", thinker->cachable);
|
||||
|
||||
if (thinker->cachable == true)
|
||||
{
|
||||
// put cachable thinkers in the mobj cache, so we can avoid allocations
|
||||
|
||||
Reference in new issue
Block a user