mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
Fix some bugs
This commit is contained in:
@@ -79,7 +79,6 @@ Texture::Texture(const ImagePtr& image, bool buildMipmaps)
|
||||
|
||||
Texture::~Texture()
|
||||
{
|
||||
assert(!g_app.isTerminated());
|
||||
// free texture from gl memory
|
||||
if(g_graphics.ok() && m_id != 0)
|
||||
glDeleteTextures(1, &m_id);
|
||||
|
@@ -40,9 +40,12 @@ void TextureManager::terminate()
|
||||
#ifndef NDEBUG
|
||||
// check for leaks
|
||||
int refs = 0;
|
||||
for(const auto& it : m_textures)
|
||||
if(it.second->ref_count() > 1)
|
||||
for(const auto& it : m_textures) {
|
||||
if(it.second->ref_count() > 1) {
|
||||
refs++;
|
||||
g_logger.debug(stdext::format("texture reference released: %s", it.first));
|
||||
}
|
||||
}
|
||||
if(refs > 0)
|
||||
g_logger.debug(stdext::format("%d textures references left", refs));
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user