Skip to content

Commit

Permalink
Merge pull request #1722 from uubulb/fix_windows_mem
Browse files Browse the repository at this point in the history
fix(mem): possible memory leak on Windows
  • Loading branch information
shirou authored Oct 11, 2024
2 parents 3045797 + 3773f6f commit 44c71b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mem/mem_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ func SwapMemoryWithContext(ctx context.Context) (*SwapMemoryStat, error) {
if err != nil {
return nil, err
}
defer common.PdhCloseQuery.Call(uintptr(counter.Query))

usedPercent, err := counter.GetValue()
if err != nil {
return nil, err
Expand Down

0 comments on commit 44c71b6

Please sign in to comment.