From: Joshua Pritikin Date: Mon, 22 Feb 1999 11:29:09 +0000 (-0500) Subject: improved error message [PATCH _55] [RESEND] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6f44e0a465a27bf3feb247a739669f0da7dbd295;p=p5sagit%2Fp5-mst-13.2.git improved error message [PATCH _55] [RESEND] Message-ID: p4raw-id: //depot/perl@3018 --- diff --git a/sv.c b/sv.c index acc8ae5..8a0334e 100644 --- a/sv.c +++ b/sv.c @@ -2730,6 +2730,14 @@ sv_clear(register SV *sv) } while (SvOBJECT(sv) && SvSTASH(sv) != stash); del_XRV(SvANY(&tmpref)); + + if (SvREFCNT(sv)) { + if (PL_in_clean_objs) + croak("DESTROY created new reference to dead object '%s'", + HvNAME(stash)); + /* DESTROY gave object new lease on life */ + return; + } } if (SvOBJECT(sv)) { @@ -2738,12 +2746,6 @@ sv_clear(register SV *sv) if (SvTYPE(sv) != SVt_PVIO) --PL_sv_objcount; /* XXX Might want something more general */ } - if (SvREFCNT(sv)) { - if (PL_in_clean_objs) - croak("DESTROY created new reference to dead object"); - /* DESTROY gave object new lease on life */ - return; - } } if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv)) mg_free(sv);