Catch lost cleanup task (should rarely happen).

This commit is contained in:
Daniel Nichter
2012-04-02 19:20:56 -06:00
parent 34ada21344
commit 5eaa565566

View File

@@ -49,8 +49,13 @@ sub new {
sub DESTROY {
my ($self) = @_;
my $task = $self->{task};
PTDEBUG && _d('Calling cleanup task', $task);
$task->();
if ( ref $task ) {
PTDEBUG && _d('Calling cleanup task', $task);
$task->();
}
else {
warn "Lost cleanup task";
}
return;
}