Fix a panic when we call close before wmiSVC is set.

PiperOrigin-RevId: 691499479
This commit is contained in:
Glazier Bot
2024-10-30 11:46:23 -07:00
committed by Copybara-Service
parent b971e29070
commit 2385c6d8d8

View File

@@ -66,6 +66,8 @@ func Connect() (Service, error) {
// Close frees all resources associated with a volume.
func (svc *Service) Close() {
svc.wmiIntf.Release()
svc.wmiSvc.Release()
if svc.wmiSvc != nil {
svc.wmiSvc.Release()
}
comshim.Done()
}