This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb16914
)
Re: local($tied->{foo}) leaks
author
Dave Mitchell
<davem@fdisolutions.com>
Fri, 3 May 2002 21:12:10 +0000
(22:12 +0100)
committer
Rafael Garcia-Suarez
<rgarciasuarez@gmail.com>
Fri, 3 May 2002 20:45:58 +0000
(20:45 +0000)
Message-ID: <
20020503211210
.B22026@fdgroup.com>
p4raw-id: //depot/perl@16383
scope.c
patch
|
blob
|
blame
|
history
diff --git
a/scope.c
b/scope.c
index
85a0680
..
a7d55b0
100644
(file)
--- a/
scope.c
+++ b/
scope.c
@@
-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;
}