summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Tanja.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/Tanja.pm b/Tanja.pm
index fcd72ef..ad9fd12 100644
--- a/Tanja.pm
+++ b/Tanja.pm
@@ -265,9 +265,11 @@ sub _err {
sub close {
- $_[0]->_cleanup;
- $_[0]->{write_handle}->push_shutdown;
- $_[0]->{read_handle}->push_shutdown;
+ my $s = shift;
+ AnyEvent::postpone {
+ $s->_cleanup;
+ $s->{write_handle}->push_shutdown;
+ };
}