diff options
author | Doug MacEachern <dougm@covalent.net> | 2001-08-02 13:24:55 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-08-03 12:09:50 +0000 |
commit | 5f8cb0464db8019389b7bf1816b817fa4d44ca34 (patch) | |
tree | df56724573529c8bbcedb239c398ae4f2abeb257 /perl.c | |
parent | bc0a45ed05a5ed25882d9d65d5140ab818bd1fbf (diff) | |
download | perl-5f8cb0464db8019389b7bf1816b817fa4d44ca34.tar.gz |
[patch] plug PL_regex_padav leaks
Message-ID: <Pine.LNX.4.21.0108022020100.8991-100000@mako.covalent.net>
p4raw-id: //depot/perl@11560
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -466,6 +466,28 @@ perl_destruct(pTHXx) } #endif +#ifdef USE_ITHREADS + /* the syntax tree is shared between clones + * so op_free(PL_main_root) only ReREFCNT_dec's + * REGEXPs in the parent interpreter + * we need to manually ReREFCNT_dec for the clones + */ + { + I32 i = AvFILLp(PL_regex_padav) + 1; + SV **ary = AvARRAY(PL_regex_padav); + + while (i) { + REGEXP *re = (REGEXP *)SvIVX(ary[--i]); + if (re && (re->refcnt > 0)) { + ReREFCNT_dec(re); + } + } + } + SvREFCNT_dec(PL_regex_padav); + PL_regex_padav = Nullav; + PL_regex_pad = NULL; +#endif + /* loosen bonds of global variables */ if(PL_rsfp) { |