瀏覽代碼

Examples: Fixed resource leaks warnings.

bkaradzic 12 年之前
父節點
當前提交
781c9cda5b
共有 3 個文件被更改,包括 6 次插入0 次删除
  1. 2 0
      examples/11-fontsdf/fontsdf.cpp
  2. 2 0
      examples/12-lod/lod.cpp
  3. 2 0
      examples/common/cube_atlas.cpp

+ 2 - 0
examples/11-fontsdf/fontsdf.cpp

@@ -240,6 +240,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 		bgfx::frame();
 	}
 
+	imguiDestroy();
+
 	free(bigText);
 
 	fontManager->destroyTtf(font);

+ 2 - 0
examples/12-lod/lod.cpp

@@ -535,6 +535,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 		bgfx::frame();
 	}
 
+	imguiDestroy();
+
 	for (uint32_t ii = 0; ii < 3; ++ii)
 	{
 		mesh_top[ii].unload();

+ 2 - 0
examples/common/cube_atlas.cpp

@@ -309,6 +309,8 @@ Atlas::Atlas(uint16_t _textureSize, const uint8_t* _textureBuffer, uint16_t _reg
 
 Atlas::~Atlas()
 {
+	bgfx::destroyTexture(m_textureHandle);
+
 	delete [] m_layers;
 	delete [] m_regions;
 	delete [] m_textureBuffer;