From 9bb105711aefb523e6dfeb3c0e61bd969b6831e7 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sat, 2 Sep 2017 14:39:21 -0300 Subject: [PATCH] Fix a Font texture memory leak when love.window.setMode is called (resolves issue #1338). --HG-- branch : minor --- src/modules/graphics/Font.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/graphics/Font.cpp b/src/modules/graphics/Font.cpp index 8c9c27f5c..a746a431a 100644 --- a/src/modules/graphics/Font.cpp +++ b/src/modules/graphics/Font.cpp @@ -122,6 +122,8 @@ Font::TextureSize Font::getNextTextureSize() const bool Font::loadVolatile() { textureCacheID++; + glyphs.clear(); + images.clear(); createTexture(); return true; } @@ -183,6 +185,8 @@ void Font::createTexture() void Font::unloadVolatile() { + glyphs.clear(); + images.clear(); } love::font::GlyphData *Font::getRasterizerGlyphData(uint32 glyph)