diff options
author | David Mitchell <davem@iabyn.com> | 2011-05-03 17:16:29 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-05-19 14:49:43 +0100 |
commit | f350200ecf1b0467f7149472cc5aeee9c4d176d1 (patch) | |
tree | 37d86b8b27230ecf49c109761091757b8d5319bf /sv.c | |
parent | ef60ac00626a1b26275244b3fa3ce49a3223baba (diff) | |
download | perl-f350200ecf1b0467f7149472cc5aeee9c4d176d1.tar.gz |
HV backrefs: another simplification
Now that HV backrefs are only stored in HvAUX, don't go looking for them
in magic too in sv_clear()
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -6054,9 +6054,12 @@ Perl_sv_clear(pTHX_ SV *const orig_sv) if (type >= SVt_PVMG) { /* Free back-references before magic, in case the magic calls * Perl code that has weak references to sv. */ - if (type == SVt_PVHV) + if (type == SVt_PVHV) { Perl_hv_kill_backrefs(aTHX_ MUTABLE_HV(sv)); - if (type == SVt_PVMG && SvPAD_OUR(sv)) { + if (SvMAGIC(sv)) + mg_free(sv); + } + else if (type == SVt_PVMG && SvPAD_OUR(sv)) { SvREFCNT_dec(SvOURSTASH(sv)); } else if (SvMAGIC(sv)) { /* Free back-references before other types of magic. */ |