From: Gurusamy Sarathy Date: Sat, 18 Jul 1998 01:22:35 +0000 (+0000) Subject: fix CvMUTEXP() leaks with -Dusethreads X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f6aaf50100351be0339a4acf484db91a3c02a9ca;p=p5sagit%2Fp5-mst-13.2.git fix CvMUTEXP() leaks with -Dusethreads p4raw-id: //depot/perl@1524 --- diff --git a/op.c b/op.c index ecefb83..a123b58 100644 --- a/op.c +++ b/op.c @@ -3532,7 +3532,8 @@ newSUB(I32 floor, OP *o, OP *proto, OP *block) CvSTASH(cv) = curstash; #ifdef USE_THREADS CvOWNER(cv) = 0; - New(666, CvMUTEXP(cv), 1, perl_mutex); + if (!CvMUTEXP(cv)) + New(666, CvMUTEXP(cv), 1, perl_mutex); MUTEX_INIT(CvMUTEXP(cv)); #endif /* USE_THREADS */ diff --git a/toke.c b/toke.c index db87758..9685fc3 100644 --- a/toke.c +++ b/toke.c @@ -5967,9 +5967,6 @@ start_subparse(I32 is_format, U32 flags) av_store(comppad_name, 0, newSVpv("@_", 2)); curpad[0] = (SV*)newAV(); SvPADMY_on(curpad[0]); /* XXX Needed? */ - CvOWNER(compcv) = 0; - New(666, CvMUTEXP(compcv), 1, perl_mutex); - MUTEX_INIT(CvMUTEXP(compcv)); #endif /* USE_THREADS */ comppadlist = newAV();