If ->idle_done was handled successfully, we can just
let normal ->DESTROY disconnect and avoid ugly backtraces
when a user hits Ctrl-C to take down the process group.
}
if (my $idle_mic = $self->{idle_mic}) {
eval { $idle_mic->done };
- warn "IDLE DONE error: $@\n" if $@;
- eval { $idle_mic->disconnect };
- warn "IDLE LOGOUT error: $@\n" if $@;
+ if ($@) {
+ warn "IDLE DONE error: $@\n";
+ eval { $idle_mic->disconnect };
+ warn "IDLE LOGOUT error: $@\n" if $@;
+ }
}
}