summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerard Goossen <gerard@tty.nl>2008-03-26 15:07:13 +0100
committerNicholas Clark <nick@ccl4.org>2008-03-29 00:30:42 +0000
commitd17ea59705db215628334e7846dd1056ff795f97 (patch)
tree6bc877f8ef5b359c1dc6347af84fb55f499d0450
parent02eafbe222bf49be10da28fb9c8c34dd786eaa91 (diff)
downloadperl-d17ea59705db215628334e7846dd1056ff795f97.tar.gz
do not use SVTYPEMASK to prevent cleaning of PL_fdpid and PL_strtab
Message-ID: <20080326130713.GL4409@ostwald> Date: Wed, 26 Mar 2008 14:07:13 +0100 p4raw-id: //depot/perl@33595
-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);