--- AnyEvent-Fork-RPC/RPC.pm 2013/04/18 20:27:02 1.19 +++ AnyEvent-Fork-RPC/RPC.pm 2013/04/20 16:07:40 1.20 @@ -552,7 +552,8 @@ if (@rcb || %rcb) { $on_error->("unexpected eof"); } else { - $on_destroy->(); + $on_destroy->() + if $on_destroy; } } elsif ($! != Errno::EAGAIN && $! != Errno::EWOULDBLOCK) { undef $rw; undef $ww; # it ends here @@ -578,7 +579,7 @@ $rcb{$id} = pop; - $guard; # keep it alive + $guard if 0; # keep it alive $wbuf .= pack "LL/a*", $id, &$f; $ww ||= $fh && AE::io $fh, 1, $wcb;