summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perl.c9
-rw-r--r--sv.c2
2 files changed, 3 insertions, 8 deletions
diff --git a/perl.c b/perl.c
index 1abb48dbcf..57f2938a77 100644
--- a/perl.c
+++ b/perl.c
@@ -1127,18 +1127,11 @@ perl_destruct(pTHXx)
}
/* Now absolutely destruct everything, somehow or other, loops or no. */
- SvFLAGS(PL_fdpid) |= SVTYPEMASK; /* don't clean out pid table now */
- SvFLAGS(PL_strtab) |= SVTYPEMASK; /* don't clean out strtab now */
/* the 2 is for PL_fdpid and PL_strtab */
- while (PL_sv_count > 2 && sv_clean_all())
+ while (sv_clean_all() > 2)
;
- SvFLAGS(PL_fdpid) &= ~SVTYPEMASK;
- SvFLAGS(PL_fdpid) |= SVt_PVAV;
- SvFLAGS(PL_strtab) &= ~SVTYPEMASK;
- SvFLAGS(PL_strtab) |= SVt_PVHV;
-
AvREAL_off(PL_fdpid); /* no surviving entries */
SvREFCNT_dec(PL_fdpid); /* needed in io_close() */
PL_fdpid = NULL;
diff --git a/sv.c b/sv.c
index e800bd75f6..8d986b7e3a 100644
--- a/sv.c
+++ b/sv.c
@@ -516,6 +516,8 @@ static void
do_clean_all(pTHX_ SV *const sv)
{
dVAR;
+ if (sv == PL_fdpid || sv == PL_strtab) /* don't clean pid table and strtab */
+ return;
DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning loops: SV at 0x%"UVxf"\n", PTR2UV(sv)) ));
SvFLAGS(sv) |= SVf_BREAK;
SvREFCNT_dec(sv);