nil out layers when dropping to allow for GC

This commit is contained in:
Jeromy 2020-04-02 18:20:49 -07:00
parent 212c346c21
commit 89b15c03cf

View File

@ -50,6 +50,7 @@ func (ss *stateSnaps) addLayer() {
}
func (ss *stateSnaps) dropLayer() {
ss.layers[len(ss.layers)-1] = nil // allow it to be GCed
ss.layers = ss.layers[:len(ss.layers)-1]
}