X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDevel%2FGlobalDestruction.pm;h=dc7be3ff8a8765d06814d32c2f89ab78da460ea9;hb=9d5ad1437b7ce54305830df01e1ce0d8bcbfed35;hp=99bc19db5dabbf128e0d78181553a682e8daf109;hpb=989c3c9a95d084538ff771342426fbc8485b6276;p=p5sagit%2FDevel-GlobalDestruction.git 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