diff --git a/mem/mem_windows.go b/mem/mem_windows.go index 522cfd1b3..a94b61f4b 100644 --- a/mem/mem_windows.go +++ b/mem/mem_windows.go @@ -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