From: Dave Mitchell Date: Sun, 15 May 2005 00:09:35 +0000 (+0000) Subject: avoid leaked scalar in BEGIN { threads->new(...) } X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6d26897eff477490c61337cb738793fba583c7b6;p=p5sagit%2Fp5-mst-13.2.git avoid leaked scalar in BEGIN { threads->new(...) } p4raw-id: //depot/perl@24469 --- diff --git a/sv.c b/sv.c index 3d4d5b2..06e23ea 100644 --- a/sv.c +++ b/sv.c @@ -12425,6 +12425,12 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, SvREFCNT_dec(param->stashes); + /* orphaned? eg threads->new inside BEGIN or use */ + if (PL_compcv && ! SvREFCNT(PL_compcv)) { + SvREFCNT_inc(PL_compcv); + SAVEFREESV(PL_compcv); + } + return my_perl; }