Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

remove reg close #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions perflib/perflib.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ func queryRawData(query string) ([]byte, error) {
return nil, fmt.Errorf("failed to encode query string: %v", err)
}

defer syscall.RegCloseKey(syscall.HKEY_PERFORMANCE_DATA)

for {
bufLen := uint32(len(buffer))

Expand All @@ -237,7 +235,6 @@ func queryRawData(query string) ([]byte, error) {
newBuffer := make([]byte, len(buffer)+16384)
copy(newBuffer, buffer)
buffer = newBuffer
syscall.RegCloseKey(syscall.HKEY_PERFORMANCE_DATA)
continue
} else if err != nil {
if errno, ok := err.(syscall.Errno); ok {
Expand Down