S_del_body is sufficiently small that inlining it is a space win.
[p5sagit/p5-mst-13.2.git] / mg.c
diff --git a/mg.c b/mg.c
index 4c01018..36ee9d6 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1673,6 +1673,10 @@ Perl_magic_setarylen(pTHX_ SV *sv, MAGIC *mg)
 int
 Perl_magic_freearylen_p(pTHX_ SV *sv, MAGIC *mg)
 {
+    /* during global destruction, mg_obj may already have been freed */
+    if (PL_in_clean_all)
+       return 0;
+
     mg = mg_find (mg->mg_obj, PERL_MAGIC_arylen);
 
     if (mg) {