Message-Id: <fi
41105602ds7a9o4fko2oae7aokbg6als@4ax.com>
Avoid threads+win32 crash by freeing Perl interpreter slightly later
p4raw-id: //depot/perl@22201
void
Perl_ithread_destruct (pTHX_ ithread* thread, const char *why)
{
+ PerlInterpreter *freeperl = NULL;
MUTEX_LOCK(&thread->mutex);
if (!thread->next) {
Perl_croak(aTHX_ "panic: destruct destroyed thread %p (%s)",thread, why);
thread->params = Nullsv;
perl_destruct(thread->interp);
- perl_free(thread->interp);
+ freeperl = thread->interp;
thread->interp = NULL;
}
MUTEX_UNLOCK(&thread->mutex);
MUTEX_DESTROY(&thread->mutex);
PerlMemShared_free(thread);
+ if (freeperl)
+ perl_free(freeperl);
PERL_SET_CONTEXT(aTHX);
}