Using the sfree() macro, the loop variable was accidentally set to NULL at the
end of the loop, causing the loop to terminate after the first iteration.
t = perl_threads->tail;
while (NULL != t) {
+ c_ithread_t *last = NULL;
+
aTHX = t->interp;
PERL_SET_CONTEXT (aTHX);
+ log_debug ("Shutting down Perl interpreter %p...", aTHX);
+
#if COLLECT_DEBUG
sv_report_used ();
#endif /* COLLECT_DEBUG */
perl_destruct (aTHX);
perl_free (aTHX);
+ last = t;
t = t->prev;
- sfree (t);
+ sfree (last);
}
pthread_mutex_unlock (&perl_threads->mutex);