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

fix(mem): possible memory leak on Windows

This commit is contained in:
uubulb 2024-10-05 15:29:36 +08:00
parent 45e3591650
commit 3773f6fe43

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