From 368a2bc5559829b5f4325301364790efeb9de236 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 18 Nov 2007 20:37:36 +0100 Subject: [PATCH] perl plugin: Fixed error in ithread shutdown loop. 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. --- src/perl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/perl.c b/src/perl.c index d6371dba..5cec1ed8 100644 --- a/src/perl.c +++ b/src/perl.c @@ -945,9 +945,13 @@ static int perl_shutdown (void) 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 */ @@ -955,9 +959,10 @@ static int perl_shutdown (void) perl_destruct (aTHX); perl_free (aTHX); + last = t; t = t->prev; - sfree (t); + sfree (last); } pthread_mutex_unlock (&perl_threads->mutex); -- 2.30.2