Skip to content

Commit

Permalink
close sth's on Fatal to prevent error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Feb 14, 2019
1 parent d3a8117 commit 62bf7d5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/ZoneMinder/lib/ZoneMinder/Logger.pm
Expand Up @@ -696,10 +696,15 @@ sub error {
}

sub Fatal( @ ) {
fetch()->logPrint(FATAL, @_, caller);
my $this = fetch();
$this->logPrint(FATAL, @_, caller);
if ( $SIG{TERM} and ( $SIG{TERM} ne 'DEFAULT' ) ) {
$SIG{TERM}();
}
if ( $$this{sth} ) {
$$this{sth}->finish();
$$this{sth} = undef;
}
# I think if we don't disconnect we will leave sockets around in TIME_WAIT
ZoneMinder::Database::zmDbDisconnect();
exit(-1);
Expand Down

0 comments on commit 62bf7d5

Please sign in to comment.