From bfb2b1bdf3d580a6658c9a2d772a42a43ba138a4 Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Tue, 22 Mar 2016 20:58:47 -0400 Subject: [PATCH] Tweak font cache agression --- src/util/GLFont.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/GLFont.cpp b/src/util/GLFont.cpp index c3b9555..c821351 100644 --- a/src/util/GLFont.cpp +++ b/src/util/GLFont.cpp @@ -445,7 +445,7 @@ void GLFont::drawString(std::string str, float xpos, float ypos, int pxHeight, A std::lock_guard lock(cache_busy); - if (gcCounter > 200) { + if (gcCounter > 50) { doCacheGC(); gcCounter = 0; } @@ -678,6 +678,8 @@ void GLFont::doCacheGC() { for (cache_iter = stringCache.begin(); cache_iter != stringCache.end(); cache_iter++) { cache_iter->second->gc--; + } + for (cache_iter = stringCache.begin(); cache_iter != stringCache.end(); cache_iter++) { if (cache_iter->second->gc < -10) { // std::cout << "gc'd " << cache_iter->first << std::endl; stringCache.erase(cache_iter);