Method: ReservedNames::Win32::Handle.close_handle_finalizer

Defined in:
lib/chef/win32/handle.rb

.close_handle_finalizer(handle) ⇒ Object



40
41
42
43
44
45
# File 'lib/chef/win32/handle.rb', line 40

def self.close_handle_finalizer(handle)
  # According to http://msdn.microsoft.com/en-us/library/windows/desktop/ms683179(v=vs.85).aspx, it is not necessary
  # to close the pseudo handle returned by the GetCurrentProcess function.  The docs also say that it doesn't hurt to call
  # CloseHandle on it. However, doing so from inside of Ruby always seems to produce an invalid handle error.
  proc { close_handle(handle) unless handle == CURRENT_PROCESS_HANDLE }
end