From: Vincent Pit Date: Sat, 20 Sep 2008 22:57:06 +0000 (+0200) Subject: Really don't try to read the context before we're sure we are not dirty X-Git-Tag: v0.20~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=73394f27221b951647864ce37cf623661c480d2e;p=perl%2Fmodules%2FVariable-Magic.git Really don't try to read the context before we're sure we are not dirty --- diff --git a/Magic.xs b/Magic.xs index b4ff243..c692014 100644 --- a/Magic.xs +++ b/Magic.xs @@ -637,7 +637,6 @@ STATIC I32 vmg_svt_val(pTHX_ IV action, SV *sv) { STATIC int vmg_wizard_free(pTHX_ SV *wiz, MAGIC *mg) { char buf[8]; MGWIZ *w; - dMY_CXT; if (PL_dirty) /* during global destruction, the context is already freed */ return 0; @@ -649,6 +648,7 @@ STATIC int vmg_wizard_free(pTHX_ SV *wiz, MAGIC *mg) { w->owner = NULL; #endif /* VMG_MULTIPLICITY */ + dMY_CXT; if (hv_delete(MY_CXT.wizz, buf, sprintf(buf, "%u", w->sig), 0)) { --MY_CXT.count; }