diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2002-05-03 22:12:10 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2002-05-03 20:45:58 +0000 |
commit | 6517de32d2d655b4824454d9b84e3bcde2d08f3c (patch) | |
tree | 2f65fd70b52bd15ef4cd2ef8505867e99201e035 /scope.c | |
parent | bb16914a1b288b55cfa63f9fac29d11db6d49b56 (diff) | |
download | perl-6517de32d2d655b4824454d9b84e3bcde2d08f3c.tar.gz |
Re: local($tied->{foo}) leaks
Message-ID: <20020503211210.B22026@fdgroup.com>
p4raw-id: //depot/perl@16383
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -206,6 +206,12 @@ S_save_scalar_at(pTHX_ SV **sptr) PL_localizing = 1; SvSETMAGIC(sv); PL_localizing = 0; + /* If we're localizing a tied array/hash element, this new sv + * won't actually be stored in the array/hash - so it won't get + * reaped when the localize ends. Ensure it gets reaped by + * mortifying it instead. DAPM */ + if (SvTIED_mg(sv, PERL_MAGIC_tiedelem)) + sv_2mortal(sv); } return sv; } |