From: Vincent Pit Date: Mon, 9 Feb 2009 00:07:02 +0000 (+0100) Subject: Really skip free callbacks during global destruction X-Git-Tag: v0.30~10 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=ad35a536408f80d3966dadb068da6ed5f8975111;p=perl%2Fmodules%2FVariable-Magic.git Really skip free callbacks during global destruction --- diff --git a/Magic.xs b/Magic.xs index 41bf22d..a922c2f 100644 --- a/Magic.xs +++ b/Magic.xs @@ -670,13 +670,13 @@ STATIC int vmg_svt_clear(pTHX_ SV *sv, MAGIC *mg) { } STATIC int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) { - SV *wiz = (SV *) mg->mg_ptr; const MGWIZ *w; unsigned int flags; int ret = 0; - /* This may happen in global destruction */ - if (SvTYPE(wiz) == SVTYPEMASK) + /* Don't even bother if we are in global destruction - the wizard is prisoner + * of circular references and we are way beyond user realm */ + if (PL_dirty) return 0; w = SV2MGWIZ(mg->mg_ptr);