diff options
author | Gerard Goossen <gerard@tty.nl> | 2008-03-26 15:07:13 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-03-29 00:30:42 +0000 |
commit | d17ea59705db215628334e7846dd1056ff795f97 (patch) | |
tree | 6bc877f8ef5b359c1dc6347af84fb55f499d0450 | |
parent | 02eafbe222bf49be10da28fb9c8c34dd786eaa91 (diff) | |
download | perl-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.c | 9 | ||||
-rw-r--r-- | sv.c | 2 |
2 files changed, 3 insertions, 8 deletions
@@ -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; @@ -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); |