]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Skip wizard destructor during global destruction
authorVincent Pit <vince@profvince.com>
Sat, 20 Sep 2008 14:01:08 +0000 (16:01 +0200)
committerVincent Pit <vince@profvince.com>
Sat, 20 Sep 2008 14:01:08 +0000 (16:01 +0200)
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)) {