summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorJoshua Pritikin <joshua.pritikin@db.com>1999-02-22 06:29:09 -0500
committerGurusamy Sarathy <gsar@cpan.org>1999-02-24 04:15:18 +0000
commit6f44e0a465a27bf3feb247a739669f0da7dbd295 (patch)
tree3259b47285aa58ebfafc43439e6e497c9cffc2ad /sv.c
parent2b5ab1e742ea1b1374dcea7f6f90ef5c5cf29914 (diff)
downloadperl-6f44e0a465a27bf3feb247a739669f0da7dbd295.tar.gz
improved error message [PATCH _55] [RESEND]
Message-ID: <Pine.GSO.4.02.9902221128200.500-100000@eq1062.wks.na.deuba.com> p4raw-id: //depot/perl@3018
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sv.c b/sv.c
index acc8ae5913..8a0334e4c9 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);