class_of for DEMOLISHALL
Shawn M Moore [Sat, 28 Mar 2009 21:06:27 +0000 (17:06 -0400)]
lib/Moose/Object.pm

index cc80c9c..98b3c46 100644 (file)
@@ -51,7 +51,7 @@ sub DEMOLISHALL {
     # need to do this first, to avoid
     # extra meta level calls    
     return unless $self->can('DEMOLISH');
-    foreach my $method ($self->meta->find_all_methods_by_name('DEMOLISH')) {
+    foreach my $method (Class::MOP::class_of($self)->find_all_methods_by_name('DEMOLISH')) {
         $method->{code}->execute($self);
     }
 }