mirror of
https://github.com/edubart/otclient.git
synced 2025-11-04 20:46:24 +01:00
Fix memory leaks
* Fix recursive reference memory leak in UIWidget * Make Event/ScheduledEvent memory-leak safe * Fix exit crashs by freeing graphics resources before destroying GL context * Add many asserts to avoid any leak regression
This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
*/
|
||||
|
||||
#include "shader.h"
|
||||
#include "graphics.h"
|
||||
|
||||
#include <framework/application.h>
|
||||
#include <framework/core/resourcemanager.h>
|
||||
|
||||
Shader::Shader(Shader::ShaderType shaderType)
|
||||
@@ -41,7 +44,9 @@ Shader::Shader(Shader::ShaderType shaderType)
|
||||
|
||||
Shader::~Shader()
|
||||
{
|
||||
glDeleteShader(m_shaderId);
|
||||
assert(!g_app->isTermianted());
|
||||
if(g_graphics.ok())
|
||||
glDeleteShader(m_shaderId);
|
||||
}
|
||||
|
||||
bool Shader::compileSourceCode(const std::string& sourceCode)
|
||||
|
||||
Reference in New Issue
Block a user