From: Gerard Goossen Date: Wed, 26 Mar 2008 14:07:13 +0000 (+0100) Subject: do not use SVTYPEMASK to prevent cleaning of PL_fdpid and PL_strtab X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d17ea59705db215628334e7846dd1056ff795f97;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/perl.c b/perl.c index 1abb48d..57f2938 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 e800bd7..8d986b7 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);