]> git.g-eek.se Git - interimap.git/commitdiff
bugfix: Don't exist with the children's exist status upon error.
authorGuilhem Moulin <guilhem@fripost.org>
Mon, 27 Jul 2015 20:49:07 +0000 (22:49 +0200)
committerGuilhem Moulin <guilhem@fripost.org>
Mon, 27 Jul 2015 21:48:06 +0000 (23:48 +0200)
lib/Net/IMAP/Sync.pm

index c1bccbfd20e1c31ba2a586103e4ef9d7315ac96f..677f9916c7a34e21058d6a119be6194967b398c8 100644 (file)
@@ -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();
     }
 }