Explorar el Código

daemon/graphdriver/windows: Remove() don't use defer() in a loop

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn hace 2 años
padre
commit
75bdbf02a6
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      daemon/graphdriver/windows/windows.go

+ 1 - 1
daemon/graphdriver/windows/windows.go

@@ -345,7 +345,6 @@ func (d *Driver) Remove(id string) error {
 			if err != nil {
 			if err != nil {
 				return err
 				return err
 			}
 			}
-			defer container.Close()
 			err = container.Terminate()
 			err = container.Terminate()
 			if hcsshim.IsPending(err) {
 			if hcsshim.IsPending(err) {
 				err = container.Wait()
 				err = container.Wait()
@@ -353,6 +352,7 @@ func (d *Driver) Remove(id string) error {
 				err = nil
 				err = nil
 			}
 			}
 
 
+			_ = container.Close()
 			if err != nil {
 			if err != nil {
 				return err
 				return err
 			}
 			}