From: Peter Rabbitson Date: Wed, 13 Jun 2012 22:38:01 +0000 (+0200) Subject: De-retardize XS-less behavior under SpeedyCGI X-Git-Tag: Devel-GlobalDestruction-0.06~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d5ad1437b7ce54305830df01e1ce0d8bcbfed35;hp=989c3c9a95d084538ff771342426fbc8485b6276;p=p5sagit%2FDevel-GlobalDestruction.git De-retardize XS-less behavior under SpeedyCGI --- diff --git a/Changes b/Changes index 7edf8f8..a6bed13 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + * De-retardize XS-less behavior under SpeedyCGI + 0.05 Thu, 26 Apr 2012 * Pure-perl implementation for situations where neither ${^GLOBAL_PHASE} nor XS are available diff --git a/lib/Devel/GlobalDestruction.pm b/lib/Devel/GlobalDestruction.pm index 99bc19d..dc7be3f 100644 --- a/lib/Devel/GlobalDestruction.pm +++ b/lib/Devel/GlobalDestruction.pm @@ -21,6 +21,14 @@ elsif (eval { # the eval already installed everything, nothing to do } else { + + # SpeedyCGI runs END blocks every cycle but somehow keeps object instances + # hence DIAF + die("The pure-perl version of @{[__PACKAGE__]} can not function correctly under CGI::SpeedyCGI. " + . "Please ensure you have a working compiler, and reinstall @{[__PACKAGE__]} to enable the XS " + . "codepath.\n" + ) if $CGI::SpeedyCGI::i_am_speedy; + eval <<'PP_IGD' or die $@; my ($in_global_destruction, $before_is_installed); @@ -28,9 +36,7 @@ my ($in_global_destruction, $before_is_installed); sub in_global_destruction { $in_global_destruction } END { - # SpeedyCGI runs END blocks every cycle but somehow keeps object instances - # hence lying about it seems reasonable...ish - $in_global_destruction = 1 unless $CGI::SpeedyCGI::i_am_speedy; + $in_global_destruction = 1; } # threads do not execute the global ENDs (it would be stupid). However