Jelajahi Sumber

Fixed resource leaks in examples.

bkaradzic 13 tahun lalu
induk
melakukan
f78a18c9b7
2 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 2 0
      examples/06-bump/bump.cpp
  2. 2 0
      examples/08-update/update.cpp

+ 2 - 0
examples/06-bump/bump.cpp

@@ -469,6 +469,8 @@ int _main_(int _argc, char** _argv)
 	bgfx::destroyTexture(textureNormal);
 	bgfx::destroyTexture(textureNormal);
 	bgfx::destroyUniform(u_texColor);
 	bgfx::destroyUniform(u_texColor);
 	bgfx::destroyUniform(u_texNormal);
 	bgfx::destroyUniform(u_texNormal);
+	bgfx::destroyUniform(u_lightPosRadius);
+	bgfx::destroyUniform(u_lightRgbInnerR);
 
 
 	// Shutdown bgfx.
 	// Shutdown bgfx.
 	bgfx::shutdown();
 	bgfx::shutdown();

+ 2 - 0
examples/08-update/update.cpp

@@ -335,6 +335,8 @@ int _main_(int _argc, char** _argv)
 	bgfx::destroyIndexBuffer(ibh);
 	bgfx::destroyIndexBuffer(ibh);
 	bgfx::destroyVertexBuffer(vbh);
 	bgfx::destroyVertexBuffer(vbh);
 	bgfx::destroyProgram(program);
 	bgfx::destroyProgram(program);
+	bgfx::destroyTexture(textureCube);
+	bgfx::destroyUniform(u_texCube);
 
 
 	// Shutdown bgfx.
 	// Shutdown bgfx.
 	bgfx::shutdown();
 	bgfx::shutdown();