Closed t-geindre closed 3 hours ago
For now, I'm solving the issue like this:
//go:linkname FontCache github.com/hajimehoshi/ebiten/v2/text.faceWithCacheCache
var FontCache map[font.Face]any
func switchFont() {
// loading new one, removing old one, and then clear ebiten cache
delete(FontCache, oldFont)
}
Ebitengine Version
master
Operating System
Go Version (
go version
)1.23
What steps will reproduce the problem?
When calling
Font is cached here I'm working on an application using a lot of various fonts and I can't keep all of them loaded.
What is the expected result?
Memory usage remains stable.
What happens instead?
Memory is leaking.
Anything else you feel useful to add?
I couldn't find a way to clear this cache. Here is what I found when debugging the memory usage: