summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlog.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/log.pl b/log.pl
index 16786a0..843c149 100755
--- a/log.pl
+++ b/log.pl
@@ -22,9 +22,10 @@ tcp_connect 'unix/', $log_socket, sub {
$h->push_write($_);
}
- $h->push_shutdown;
- $h->destroy;
- $cv->send;
+ $h->on_drain (sub {
+ undef $h;
+ $cv->send;
+ });
};
$cv->recv;