diff --git a/cache/delta.go b/cache/delta.go index e7fd3f0..901d576 100644 --- a/cache/delta.go +++ b/cache/delta.go @@ -124,11 +124,18 @@ func (self *DeltaCoordsCache) SetLinearImport(v bool) { } func (self *DeltaCoordsCache) Flush() { + self.mu.Lock() + defer self.mu.Unlock() for bunchId, bunch := range self.table { if bunch.needsWrite { self.putCoordsPacked(bunchId, bunch.coords) } } + + self.lruList.Init() + for k, _ := range self.table { + delete(self.table, k) + } } func (self *DeltaCoordsCache) Close() { self.Flush()