Only warn for possible undeleted opengl stuff when debug build
Happens when you press close button in stk window.
This commit is contained in:
parent
9ecf952057
commit
d8511956f5
@ -21,6 +21,7 @@
|
|||||||
#define HEADER_SHADER_FILES_MANAGER_HPP
|
#define HEADER_SHADER_FILES_MANAGER_HPP
|
||||||
|
|
||||||
#include "graphics/gl_headers.hpp"
|
#include "graphics/gl_headers.hpp"
|
||||||
|
#include "utils/log.hpp"
|
||||||
#include "utils/no_copy.hpp"
|
#include "utils/no_copy.hpp"
|
||||||
#include "utils/singleton.hpp"
|
#include "utils/singleton.hpp"
|
||||||
|
|
||||||
@ -60,7 +61,13 @@ public:
|
|||||||
void removeAllShaderFiles()
|
void removeAllShaderFiles()
|
||||||
{
|
{
|
||||||
removeUnusedShaderFiles();
|
removeUnusedShaderFiles();
|
||||||
assert(m_shader_files_loaded.empty());
|
if (!m_shader_files_loaded.empty())
|
||||||
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
Log::error("ShaderFilesManager", "Some shader file > 1 ref_count");
|
||||||
|
#endif
|
||||||
|
m_shader_files_loaded.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
void removeUnusedShaderFiles()
|
void removeUnusedShaderFiles()
|
||||||
|
@ -139,10 +139,12 @@ SPShaderManager::~SPShaderManager()
|
|||||||
{
|
{
|
||||||
m_official_shaders.clear();
|
m_official_shaders.clear();
|
||||||
removeUnusedShaders();
|
removeUnusedShaders();
|
||||||
|
#ifdef DEBUG
|
||||||
for (auto p : m_shaders)
|
for (auto p : m_shaders)
|
||||||
{
|
{
|
||||||
Log::error("SPShaderManager", "%s > 1 ref_count", p.first.c_str());
|
Log::error("SPShaderManager", "%s > 1 ref_count", p.first.c_str());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} // ~SPShaderManager
|
} // ~SPShaderManager
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -89,10 +89,12 @@ SPTextureManager::~SPTextureManager()
|
|||||||
}
|
}
|
||||||
m_threaded_load_obj.clear();
|
m_threaded_load_obj.clear();
|
||||||
removeUnusedTextures();
|
removeUnusedTextures();
|
||||||
|
#ifdef DEBUG
|
||||||
for (auto p : m_textures)
|
for (auto p : m_textures)
|
||||||
{
|
{
|
||||||
Log::error("SPTextureManager", "%s > 1 ref_count", p.first.c_str());
|
Log::error("SPTextureManager", "%s > 1 ref_count", p.first.c_str());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} // ~SPTextureManager
|
} // ~SPTextureManager
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user