daemon/graphdriver/windows: Remove() don't use defer() in a loop
@@ -345,7 +345,6 @@ func (d *Driver) Remove(id string) error {
if err != nil {
return err
}
- defer container.Close()
err = container.Terminate()
if hcsshim.IsPending(err) {
err = container.Wait()
@@ -353,6 +352,7 @@ func (d *Driver) Remove(id string) error {
err = nil
}
+ _ = container.Close()
if err != nil {
return err
}
