From: Dave Rolsky <autarch@urth.org>
Date: Mon, 6 Apr 2009 16:41:50 +0000 (-0500)
Subject: Fix the is_needed method to actually check the right thing.
X-Git-Tag: 0.73_02~9
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ccf2ab020ce0ea58efce66e8c7450875eafe9c0;p=gitmo%2FMoose.git

Fix the is_needed method to actually check the right thing.
---

diff --git a/lib/Moose/Meta/Method/Destructor.pm b/lib/Moose/Meta/Method/Destructor.pm
index 1f5cc87..93d7f83 100644
--- a/lib/Moose/Meta/Method/Destructor.pm
+++ b/lib/Moose/Meta/Method/Destructor.pm
@@ -57,7 +57,7 @@ sub is_needed {
         || $self->throw_error(
         "The is_needed method expected a metaclass object as its arugment");
 
-    return Class::MOP::class_of($metaclass)->can('DEMOLISH');
+    return $metaclass->find_next_method_by_name('DEMOLISH');
 }
 
 sub initialize_body {