瀏覽代碼

Images don't hold on to RAM copies of their contents anymore

Alex Szpakowski 5 年之前
父節點
當前提交
5031cb5f56
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/modules/graphics/opengl/Texture.cpp

+ 4 - 0
src/modules/graphics/opengl/Texture.cpp

@@ -218,6 +218,10 @@ Texture::Texture(const Settings &settings, const Slices *data)
 		if (textureGLError != GL_NO_ERROR)
 			throw love::Exception("Cannot create Texture (OpenGL error: %s)", OpenGL::errorString(textureGLError));
 	}
+
+	// ImageData is referenced by the first loadVolatile call, but we don't
+	// hang on to it after that so we can save memory.
+	slices.clear();
 }
 
 Texture::~Texture()