prefer polymorphism on existing destructor over custom destructor method
This commit is contained in:
parent
055cbc85de
commit
e0789366e7
3 changed files with 35 additions and 9 deletions
|
|
@ -7,8 +7,9 @@ require_ok('director_finalizer');
|
|||
{
|
||||
package MyFoo;
|
||||
use base 'director_finalizer::Foo';
|
||||
sub DIRECTOR_DESTROY { my($self) = @_;
|
||||
$self->orStatus(2);
|
||||
sub DESTROY { my($self, $final) = @_;
|
||||
$self->orStatus(2) if $final;
|
||||
shift->SUPER::DESTROY(@_);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue