From: Jan Dubois Date: Wed, 2 Dec 2009 09:34:18 +0000 (-0800) Subject: Cleanup all scopes before exiting a pseudo-forked process. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=adab9969;p=p5sagit%2Fp5-mst-13.2.git Cleanup all scopes before exiting a pseudo-forked process. perl_destruct() contains an assertion that the scope stack is empty. The remaining scopes are due to fork() being called from within a BEGIN block. --- diff --git a/win32/perlhost.h b/win32/perlhost.h index 61f8765..5e89f85 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -1769,6 +1769,11 @@ restart: switch (status) { case 0: CALLRUNOPS(aTHX); + /* We may have additional unclosed scopes if fork() was called + * from within a BEGIN block. See perlfork.pod for more details. + */ + while (PL_scopestack_ix > oldscope) + LEAVE; status = 0; break; case 2: