X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FModule.pm;h=6934eb1db3d2c6a2828dbc5ef85b6e6deae08ceb;hb=ac3bb63341584a1de80eb26340d9b877624c1834;hp=bc74808e126f3533c1d2c19179a3e5fc6aa2bc9d;hpb=f87debb99f7c14e24071098c395fbe7331894d49;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Module.pm b/lib/Mouse/Meta/Module.pm index bc74808..6934eb1 100755 --- a/lib/Mouse/Meta/Module.pm +++ b/lib/Mouse/Meta/Module.pm @@ -6,7 +6,7 @@ use Scalar::Util (); my %METAS; -if(Mouse::Util::_MOUSE_XS){ +if(Mouse::Util::MOUSE_XS){ # register meta storage for performance Mouse::Util::__register_metaclass_storage(\%METAS, 0); @@ -16,6 +16,7 @@ if(Mouse::Util::_MOUSE_XS){ sub _metaclass_cache { # DEPRECATED my($class, $name) = @_; + Carp::cluck('_metaclass_cache() has been deprecated. Use Mouse::Util::get_metaclass_by_name() instead'); return $METAS{$name}; } @@ -78,7 +79,7 @@ sub namespace; # add_attribute is an abstract method sub get_attribute_map { # DEPRECATED - Carp::cluck('get_attribute_map() has been deprecated'); + Carp::cluck('get_attribute_map() has been deprecated. Use get_attribute_list() and get_attribute() instead'); return $_[0]->{attributes}; } @@ -88,7 +89,6 @@ sub remove_attribute { delete $_[0]->{attributes}->{$_[1]} } sub get_attribute_list{ keys %{$_[0]->{attributes}} } - # XXX: for backward compatibility my %foreign = map{ $_ => undef } qw( Mouse Mouse::Role Mouse::Util Mouse::Util::TypeConstraints @@ -264,6 +264,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; @@ -301,7 +303,6 @@ sub throw_error{ } 1; - __END__ =head1 NAME @@ -310,7 +311,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.4501 =head1 SEE ALSO