From d236d73a1f56a3f172fb7e439574b1a36f0a726e Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 31 Oct 2021 17:18:07 +0900 Subject: [PATCH] internal/atlas, initernal/graphics: Bug fix: Needed to reset 'notFullyUsedTime' --- internal/atlas/image.go | 1 + internal/graphics/vertex.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/atlas/image.go b/internal/atlas/image.go index b16f1d500..be134b5e8 100644 --- a/internal/atlas/image.go +++ b/internal/atlas/image.go @@ -81,6 +81,7 @@ func (t *temporaryPixels) resetAtFrameEnd() { // Let the pixels GCed if this is not used for a while. if t.notFullyUsedTime == maxNotFullyUsedTime && len(t.pixels) > 0 { t.pixels = nil + t.notFullyUsedTime = 0 } // Reset the position and reuse the allocated bytes. diff --git a/internal/graphics/vertex.go b/internal/graphics/vertex.go index 06ccc3274..8ea28fa5f 100644 --- a/internal/graphics/vertex.go +++ b/internal/graphics/vertex.go @@ -108,6 +108,7 @@ func (v *verticesBackend) lockAndReset(f func() error) error { if v.notFullyUsedTime == maxNotFullyUsedTime && len(v.backend) > 0 { v.backend = nil + v.notFullyUsedTime = 0 } v.pos = 0