mirror of
https://github.com/shirou/gopsutil.git
synced 2025-05-02 22:17:08 +08:00
Merge pull request #1221 from shirou/feature/process_win_fix_dup_handle
[process][windows] fix release handle
This commit is contained in:
commit
a3ae4bc40d
@ -703,6 +703,9 @@ func (p *Process) OpenFilesWithContext(ctx context.Context) ([]OpenFilesStat, er
|
||||
0, true, windows.DUPLICATE_SAME_ACCESS) != nil {
|
||||
continue
|
||||
}
|
||||
// release the new handle
|
||||
defer windows.CloseHandle(windows.Handle(file))
|
||||
|
||||
fileType, _ := windows.GetFileType(windows.Handle(file))
|
||||
if fileType != windows.FILE_TYPE_DISK {
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user