浏览代码

Fix a Font texture memory leak when love.window.setMode is called (resolves issue #1338).

--HG--
branch : minor
Alex Szpakowski 8 年之前
父节点
当前提交
9bb105711a
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/modules/graphics/Font.cpp

+ 4 - 0
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)