From: Dylan William Hardison Date: Thu, 11 Jun 2009 14:57:08 +0000 (+0000) Subject: Bug fix: DESTROY was being overridden by make_immutable. X-Git-Tag: 0.86~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d42eab150df35044732290db6ee810a35024c5d6;p=gitmo%2FClass-MOP.git Bug fix: DESTROY was being overridden by make_immutable. --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index d2dfd10..237023b 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -1204,6 +1204,13 @@ sub _inline_destructor { || confess "The 'inline_destructor' option is present, but " . "no destructor class was specified"; + if ($self->has_method('DESTROY') ) { + my $class = $self->name; + warn "Not inlining a destructor for $class since it defines" + . " its own destructor.\n"; + return; + } + my $destructor_class = $args{destructor_class}; Class::MOP::load_class($destructor_class);