mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Don't leak textures all over the place
This commit is contained in:
parent
2863a3291a
commit
41c00e87d4
2 changed files with 31 additions and 12 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue