From: Guilhem Moulin Date: Mon, 27 Jul 2015 20:49:07 +0000 (+0200) Subject: bugfix: Don't exist with the children's exist status upon error. X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=2a3287ab0b04341adcb8187b75cf35ac3f07d24f;p=interimap.git bugfix: Don't exist with the children's exist status upon error. --- diff --git a/lib/Net/IMAP/Sync.pm b/lib/Net/IMAP/Sync.pm index c1bccbf..677f991 100644 --- a/lib/Net/IMAP/Sync.pm +++ b/lib/Net/IMAP/Sync.pm @@ -386,9 +386,8 @@ sub new($%) { # Log out when the Net::IMAP::Sync object is destroyed. sub DESTROY($) { my $self = shift; - if (defined $self->{STDIN} and $self->{STDIN}->opened() and - defined $self->{STDOUT} and $self->{STDOUT}->opened()) { - $self->logout(); + foreach (qw/STDIN STDOUT/) { + $self->{$_}->close() if defined $self->{$_} and $self->{$_}->opened(); } }