Skip to content

Commit

Permalink
Move PERL_WAIT_FOR_CHILDREN till after we handle END blocks during de…
Browse files Browse the repository at this point in the history
…struct

See #16418

This should fix the issue with Win32.
  • Loading branch information
demerphq committed Aug 29, 2022
1 parent 795634b commit e7d9ff9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions perl.c
Expand Up @@ -631,9 +631,6 @@ perl_destruct(pTHXx)

assert(PL_scopestack_ix == 1);

/* wait for all pseudo-forked children to finish */
PERL_WAIT_FOR_CHILDREN;

destruct_level = PL_perl_destruct_level;
{
const char * const s = PerlEnv_getenv("PERL_DESTRUCT_LEVEL");
Expand Down Expand Up @@ -672,6 +669,10 @@ perl_destruct(pTHXx)
FREETMPS;
assert(PL_scopestack_ix == 0);

/* wait for all pseudo-forked children to finish */
PERL_WAIT_FOR_CHILDREN;


/* normally when we get here, PL_parser should be null due to having
* its original (null) value restored by SAVEt_PARSER during leaving
* scope (usually before run-time starts in fact).
Expand Down

0 comments on commit e7d9ff9

Please sign in to comment.