summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorBrandon Black <blblack@gmail.com>2007-06-26 06:05:31 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-06-26 16:12:27 +0000
commit22717f83d889005ea69f223baa94257d681f86d7 (patch)
tree65a4189569341479822d1bb2c6c11864520c9a71 /av.c
parent9b43931120d41c17896bde0d0bb619d0e701b0ad (diff)
downloadperl-22717f83d889005ea69f223baa94257d681f86d7.tar.gz
Second patch from:
Subject: Re: [perl #43357] *DESTROY = sub {} at runtime From: "Brandon Black" <blblack@gmail.com> Message-ID: <84621a60706260905x2da6eaf1x4bd7d5223951e52@mail.gmail.com> Fix MRO behaviour when one undefs @ISA p4raw-id: //depot/perl@31473
Diffstat (limited to 'av.c')
-rw-r--r--av.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/av.c b/av.c
index 9361e280f9..c1b03fee75 100644
--- a/av.c
+++ b/av.c
@@ -469,17 +469,20 @@ Perl_av_undef(pTHX_ register AV *av)
/* Give any tie a chance to cleanup first */
if (SvTIED_mg((SV*)av, PERL_MAGIC_tied))
- av_fill(av, -1); /* mg_clear() ? */
+ av_fill(av, -1);
if (AvREAL(av)) {
register I32 key = AvFILLp(av) + 1;
while (key)
SvREFCNT_dec(AvARRAY(av)[--key]);
}
+
Safefree(AvALLOC(av));
AvALLOC(av) = NULL;
AvARRAY(av) = NULL;
AvMAX(av) = AvFILLp(av) = -1;
+
+ if(SvRMAGICAL(av)) mg_clear((SV*)av);
}
/*