diff options
author | David Mitchell <davem@iabyn.com> | 2011-05-10 13:52:48 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-05-19 14:49:43 +0100 |
commit | 272e8453abcb0fceb34b1464670386e03a1f55bb (patch) | |
tree | e06fc67e14ac4c401993d61552405b9b42bf1e00 /hv.c | |
parent | f350200ecf1b0467f7149472cc5aeee9c4d176d1 (diff) | |
download | perl-272e8453abcb0fceb34b1464670386e03a1f55bb.tar.gz |
hv_free_ent: free SV as last action
Move the freeing of the SV from near the beginning to the end of
hv_free_ent(); i.e. free the HE before the SV. Ideally, this should cause
no change in behaviour, but will make using an iterative HV freeing
scheme easier.
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1470,7 +1470,6 @@ Perl_hv_free_ent(pTHX_ HV *hv, register HE *entry) val = HeVAL(entry); if (val && isGV(val) && isGV_with_GP(val) && GvCVu(val) && HvENAME(hv)) mro_method_changed_in(hv); /* deletion of method from stash */ - SvREFCNT_dec(val); if (HeKLEN(entry) == HEf_SVKEY) { SvREFCNT_dec(HeKEY_sv(entry)); Safefree(HeKEY_hek(entry)); @@ -1480,6 +1479,7 @@ Perl_hv_free_ent(pTHX_ HV *hv, register HE *entry) else Safefree(HeKEY_hek(entry)); del_HE(entry); + SvREFCNT_dec(val); } |