1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-24 13:48:56 +08:00

Merge pull request #1722 from uubulb/fix_windows_mem

fix(mem): possible memory leak on Windows
This commit is contained in:
shirou 2024-10-11 15:45:29 +09:00 committed by GitHub
commit 44c71b62c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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