diff --git a/lib/winrm/shells/base.rb b/lib/winrm/shells/base.rb index 3d11ac49..ed8976a0 100644 --- a/lib/winrm/shells/base.rb +++ b/lib/winrm/shells/base.rb @@ -94,6 +94,10 @@ def close @shell_id = nil end + def self.finalize(connection_opts, transport, shell_id) + proc { Thread.new { close_shell(connection_opts, transport, shell_id) } } + end + protected def send_command(_command, _arguments) @@ -183,10 +187,6 @@ def add_finalizer def remove_finalizer ObjectSpace.undefine_finalizer(self) end - - def self.finalize(connection_opts, transport, shell_id) - proc { Thread.new { close_shell(connection_opts, transport, shell_id) } } - end end end end