From: Vincent Pit Date: Sat, 5 Jul 2008 14:43:16 +0000 (+0200) Subject: Force temps cleanup after removing the wizard from the context hash, but flag it... X-Git-Tag: v0.19~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=547789f35817c76557817263360e4fa8b24b67b8;p=perl%2Fmodules%2FVariable-Magic.git Force temps cleanup after removing the wizard from the context hash, but flag it as SVf_BREAK so that it won't be freed again later --- diff --git a/Magic.xs b/Magic.xs index 416bf72..ba23045 100644 --- 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)); }