Przeglądaj źródła

Merge pull request #36256 from wcwxyz/fix-refcounter-memory-leak

graphdriver: Fix RefCounter memory leak
Tõnis Tiigi 7 lat temu
rodzic
commit
733ed2ddd3
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      daemon/graphdriver/counter.go

+ 3 - 0
daemon/graphdriver/counter.go

@@ -54,6 +54,9 @@ func (c *RefCounter) incdec(path string, infoOp func(minfo *minfo)) int {
 	}
 	infoOp(m)
 	count := m.count
+	if count <= 0 {
+		delete(c.counts, path)
+	}
 	c.mu.Unlock()
 	return count
 }