summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-23 21:30:33 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-23 21:30:33 +0000
commite15faf7d09c73a41f95fbe6a0045ad5b17c899a6 (patch)
tree63afe41128dd7c7aaaf6effdfaa6ab9d91145647 /pad.c
parent8772537cf6d022a54f738ccb84b65a7f21ccf1b2 (diff)
downloadperl-e15faf7d09c73a41f95fbe6a0045ad5b17c899a6.tar.gz
Remove the reference loop between symbol tables and typeglobs.
Typeglobs now have a weak reference onto their symbol table. p4raw-id: //depot/perl@24966
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pad.c b/pad.c
index 9c2b5a2410..ed68c40662 100644
--- a/pad.c
+++ b/pad.c
@@ -344,7 +344,8 @@ Perl_pad_add_name(pTHX_ const char *name, HV* typestash, HV* ourstash, bool fake
}
if (ourstash) {
SvFLAGS(namesv) |= SVpad_OUR;
- GvSTASH(namesv) = (HV*)SvREFCNT_inc((SV*) ourstash);
+ GvSTASH(namesv) = ourstash;
+ Perl_sv_add_backref(aTHX_ (SV*)ourstash, namesv);
}
av_store(PL_comppad_name, offset, namesv);