From 516b657b16d9af0d850f9a464e19dfa20eb3793a Mon Sep 17 00:00:00 2001 From: Stephen von Takach Date: Mon, 20 Nov 2017 08:19:40 +1100 Subject: [PATCH] (tcp) fix shutdown if there are pending writes previously this would cause an error as as finally was being called on a deferrable not the promise --- lib/libuv/tcp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libuv/tcp.rb b/lib/libuv/tcp.rb index 203b30a..7a8c76a 100644 --- a/lib/libuv/tcp.rb +++ b/lib/libuv/tcp.rb @@ -199,7 +199,7 @@ def write(data, wait: false) alias_method :do_shutdown, :shutdown def shutdown if @pending_writes && @pending_writes.length > 0 - @pending_writes[-1][0].finally { do_shutdown } + @pending_writes[-1][0].promise.finally { do_shutdown } else do_shutdown end