don't accidentally load Moo::HandleMoose during global destruction
Matt S Trout [Thu, 12 Apr 2012 21:27:16 +0000 (21:27 +0000)]
Changes
lib/Moo/sification.pm

diff --git a/Changes b/Changes
index 5835f9a..be59aed 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,4 @@
+  - don't accidentally load Moo::HandleMoose during global destruction
   - better docs for trigger (and initializer's absence)
 
 0.009_015 - 2012-04-11
index 6ad0f27..6f42dfa 100644 (file)
@@ -2,9 +2,13 @@ package Moo::sification;
 
 use strictures 1;
 
+END { our $sky_falling = 1 }
+
 sub Moo::HandleMoose::AuthorityHack::DESTROY {
-  require Moo::HandleMoose;
-  Moo::HandleMoose->import;
+  unless (our $sky_falling) {
+    require Moo::HandleMoose;
+    Moo::HandleMoose->import;
+  }
 }
 
 if ($INC{"Moose.pm"}) {