diff --git a/setupapi/types_windows.go b/setupapi/types_windows.go index e2617a4..bc6f66b 100644 --- a/setupapi/types_windows.go +++ b/setupapi/types_windows.go @@ -25,11 +25,7 @@ type DevInfo windows.Handle // Close function deletes a device information set and frees all associated memory. func (h DevInfo) Close() error { - if h != DevInfo(windows.InvalidHandle) { - return SetupDiDestroyDeviceInfoList(h) - } - - return nil + return SetupDiDestroyDeviceInfoList(h) } const (