1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 16:15:20 +02:00

Don't leak textures all over the place

This commit is contained in:
Kahrl
2012-02-02 04:11:56 +01:00
committed by Perttu Ahola
parent 2863a3291a
commit 41c00e87d4
2 changed files with 31 additions and 12 deletions

View File

@@ -433,6 +433,9 @@ video::ITexture *generateTextureFromMesh(scene::IMesh *mesh,
}
// Create render target texture
video::ITexture *oldtexture = driver->findTexture(texture_name.c_str());
if(oldtexture)
driver->removeTexture(oldtexture);
video::ITexture *rtt = driver->addRenderTargetTexture(
dim, texture_name.c_str(), video::ECF_A8R8G8B8);
if(rtt == NULL)