Checking in changes prior to tagging of version 0.40_09. Changelog diff is:
[gitmo/Mouse.git] / lib / Mouse / Meta / Module.pm
index b9281a8..94ac4bc 100755 (executable)
@@ -6,7 +6,8 @@ use Scalar::Util ();
 
 my %METAS;
 
-if(Mouse::Util::_MOUSE_XS){
+# XXX: work around a warning "useless use of a constant in void context" in 5.6.2
+if(&Mouse::Util::MOUSE_XS){
     # register meta storage for performance
     Mouse::Util::__register_metaclass_storage(\%METAS, 0);
 
@@ -32,6 +33,8 @@ sub initialize {
 sub reinitialize {
     my($class, $package_name, @args) = @_;
 
+    $package_name = $package_name->name if ref $package_name;
+
     ($package_name && !ref($package_name))
         || $class->throw_error("You must pass a package name and it cannot be blessed");
 
@@ -262,6 +265,8 @@ sub get_method_list {
     sub DESTROY{
         my($self) = @_;
 
+        return if $Mouse::Util::in_global_destruction;
+
         my $serial_id = $self->{anon_serial_id};
 
         return if !$serial_id;
@@ -308,7 +313,7 @@ Mouse::Meta::Module - The base class for Mouse::Meta::Class and Mouse::Meta::Rol
 
 =head1 VERSION
 
-This document describes Mouse version 0.40_06
+This document describes Mouse version 0.40_09
 
 =head1 SEE ALSO