mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Fix memory leak detected by address sanitizer (#10896)
This commit is contained in:
parent
f227e40180
commit
2072afb72b
4 changed files with 7 additions and 3 deletions
|
@ -75,8 +75,6 @@ video::ITexture *MenuTextureSource::getTexture(const std::string &name, u32 *id)
|
|||
if (name.empty())
|
||||
return NULL;
|
||||
|
||||
m_to_delete.insert(name);
|
||||
|
||||
#if ENABLE_GLES
|
||||
video::ITexture *retval = m_driver->findTexture(name.c_str());
|
||||
if (retval)
|
||||
|
@ -88,6 +86,7 @@ video::ITexture *MenuTextureSource::getTexture(const std::string &name, u32 *id)
|
|||
|
||||
image = Align2Npot2(image, m_driver);
|
||||
retval = m_driver->addTexture(name.c_str(), image);
|
||||
m_to_delete.insert(name);
|
||||
image->drop();
|
||||
return retval;
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue