X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FClass.pm;h=ec803e45dc6ede85085ea9b8cc8a4fd0b4b59ce1;hb=c84eee06b0afc49910837dbf3003b736d125b65d;hp=247a734490189ea878fc3e22bafce5061c6fd506;hpb=61ee520196bc6a5aefdb37435a05974f28b7952d;p=gitmo%2FMoose.git diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 247a734..ec803e4 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -448,9 +448,13 @@ sub _remove_generated_metaobjects { return if in_global_destruction(); # it'll happen soon anyway and this just makes things more complicated - no warnings 'uninitialized'; + $self->free_anon_class + unless $name =~ /^$ANON_CLASS_PREFIX/o; + } + + sub free_anon_class { + my $self = shift; my $name = $self->name; - return unless $name =~ /^$ANON_CLASS_PREFIX/o; # Moose does a weird thing where it replaces the metaclass for # class when fixing metaclass incompatibility. In that case,