From: Hugo van der Sanden Date: Mon, 12 Jun 2000 19:36:08 +0000 (+0100) Subject: [ID 20000608.006] panic: magic_killbackrefs with blessed global weakrefs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b6e653be5897e6dbe4487609bc262b6bca2afcf;p=p5sagit%2Fp5-mst-13.2.git [ID 20000608.006] panic: magic_killbackrefs with blessed global weakrefs Message-Id: <200006121836.TAA16977@crypt.compulink.co.uk> p4raw-id: //depot/perl@6901 --- diff --git a/sv.c b/sv.c index 0501dcb..8778192 100644 --- a/sv.c +++ b/sv.c @@ -8335,9 +8335,15 @@ do_clean_objs(pTHXo_ SV *sv) if (SvROK(sv) && SvOBJECT(rv = SvRV(sv))) { DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning object ref:\n "), sv_dump(sv));) - SvROK_off(sv); - SvRV(sv) = 0; - SvREFCNT_dec(rv); + if (SvWEAKREF(sv)) { + sv_del_backref(sv); + SvWEAKREF_off(sv); + SvRV(sv) = 0; + } else { + SvROK_off(sv); + SvRV(sv) = 0; + SvREFCNT_dec(rv); + } } /* XXX Might want to check arrays, etc. */