diff --git a/src/render/Shader.cpp b/src/render/Shader.cpp index 96b3caf7..d3f2afb2 100644 --- a/src/render/Shader.cpp +++ b/src/render/Shader.cpp @@ -10,4 +10,11 @@ GLint CShader::getUniformLocation(const std::string& unif) { } return itpos->second; +} + +CShader::~CShader() { + // destroy shader + if (program != 0) { + glDeleteProgram(program); + } } \ No newline at end of file diff --git a/src/render/Shader.hpp b/src/render/Shader.hpp index 3d3b3ddb..fc06d68b 100644 --- a/src/render/Shader.hpp +++ b/src/render/Shader.hpp @@ -5,7 +5,9 @@ class CShader { public: - GLuint program; + ~CShader(); + + GLuint program = 0; GLint proj; GLint color; GLint tex;