components/prboom/p_tick.c
//
// P_RemoveThinkerDelayed()
//
// Called automatically as part of the thinker loop in P_RunThinkers(),
// on nodes which are pending deletion.
//
// If this thinker has no more pointers referencing it indirectly,
// remove it, and set currentthinker to one node preceeding it, so
// that the next step in P_RunThinkers() will get its successor.
//
P_RemoveThinkerDelayed()
Called automatically as part of the thinker loop in P_RunThinkers(),
on nodes which are pending deletion.

If this thinker has no more pointers referencing it indirectly,
remove it, and set currentthinker to one node preceeding it, so
that the next step in P_RunThinkers() will get its successor.
P_RemoveThinkerDelayed () Called automatically as part of the thinker loop in P_RunThinkers () on nodes which are pending deletion . If this thinker has no more pointers referencing it indirectly remove it and set currentthinker to one node preceeding it so that the next step in P_RunThinkers () will get its successor .
void P_RemoveThinkerDelayed(thinker_t *thinker)
{
  if (!thinker->references)
    {
      { 
        thinker_t *next = thinker->next;
        (next->prev = currentthinker = thinker->prev)->next = next;
      }
      {
        thinker_t *th = thinker->cnext;
        (th->cprev = thinker->cprev)->cnext = th;
      }
      Z_Free(thinker);
    }
}
void P_RemoveThinkerDelayed ( thinker_t * thinker ) { if ( ! thinker -> references ) { { thinker_t * next = thinker -> next ; ( next -> prev = currentthinker = thinker -> prev ) -> next = next ; } { thinker_t * th = thinker -> cnext ; ( th -> cprev = thinker -> cprev ) -> cnext = th ; } Z_Free ( thinker ) ; } }
P_RemoveThinkerDelayed()
Called automatically as part of the thinker loop in P_RunThinkers(),
on nodes which are pending deletion.
P_RemoveThinkerDelayed () Called automatically as part of the thinker loop in P_RunThinkers () on nodes which are pending deletion .
/* Remove from main thinker list */ /* 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 */ /* Remove from current thinker class list */