Fix stop() call (#2660)

This commit is contained in:
Yadd 2022-02-02 12:21:09 +01:00
parent 00bf4a0d1a
commit 27df15774d
1 changed files with 9 additions and 5 deletions

View File

@ -292,12 +292,16 @@ sub stop {
#or $res == PE_FIRSTACCESS
#or $res == PE_FORMEMPTY
);
my $ret;
eval { $ret = $mod->( 'stop', $res ) };
if ($@) {
my ( $ret, $name );
( $ret, $name ) = $mod->( 'can', 'stop' );
if ($ret) {
eval { ( $ret, $name ) = $mod->( 'stop', $res ) };
if ($@) {
#$self->logger->error( 'Optional stop() method failed: ' . $@ );
return 0;
$self->logger->error(
"Optional ${name}::stop() method failed: " . $@ );
return 0;
}
}
return $ret;
}