]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - Magic.xs
Skip wizard destructor during global destruction
[perl/modules/Variable-Magic.git] / Magic.xs
index 5e76f8a73b25bdc688950214d81cf256b71c7f90..1ac63cbf205ae3ac2ed6090033cb57530e5459c5 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
@@ -623,6 +623,9 @@ STATIC int vmg_wizard_free(pTHX_ SV *wiz, MAGIC *mg) {
  MGWIZ *w;
  dMY_CXT;
 
+ if (PL_dirty) /* during global destruction, the context is already freed */
+  return 0;
+
  w = SV2MGWIZ(wiz);
 
  if (hv_delete(MY_CXT.wizz, buf, sprintf(buf, "%u", w->sig), 0)) {