]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Force temps cleanup after removing the wizard from the context hash, but flag it...
authorVincent Pit <vince@profvince.com>
Sat, 5 Jul 2008 14:43:16 +0000 (16:43 +0200)
committerVincent Pit <vince@profvince.com>
Sat, 5 Jul 2008 14:43:16 +0000 (16:43 +0200)
Magic.xs

index 416bf7286e14adec3d4db96d83a05b8c83919131..ba230455e8bfff3bf05a590a8ea017acf39bdf23 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
@@ -598,13 +598,11 @@ STATIC int vmg_wizard_free(pTHX_ SV *wiz, MAGIC *mg) {
 
  w = SV2MGWIZ(wiz);
 
- SvREFCNT_inc(wiz); /* Fake survival - it's gonna be deleted anyway */
-#if PERL_VERSION_GE(5, 9, 5)
- SvREFCNT_inc(wiz); /* One more push */
-#endif
  if (hv_delete(MY_CXT.wizz, buf, sprintf(buf, "%u", w->sig), 0)) {
   --MY_CXT.count;
  }
+ SvFLAGS(wiz) |= SVf_BREAK;
+ FREETMPS;
 
  if (w->cb_data  != NULL) { SvREFCNT_dec(SvRV(w->cb_data)); }
  if (w->cb_get   != NULL) { SvREFCNT_dec(SvRV(w->cb_get)); }