From 3779ee1b0a76f5ab1bb27f7eda81c8352c05acb9 Mon Sep 17 00:00:00 2001 From: Timo Lotterbach Date: Mon, 11 Mar 2013 07:54:33 -0700 Subject: [PATCH] GLESGraphicSystem: release shader resources on destruction Signed-off-by: Timo Lotterbach --- .../include/GraphicSystems/GLESGraphicSystem.h | 2 ++ .../Graphic/src/GraphicSystems/GLESGraphicSystem.cpp | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/LayerManagerPlugins/Renderers/Graphic/include/GraphicSystems/GLESGraphicSystem.h b/LayerManagerPlugins/Renderers/Graphic/include/GraphicSystems/GLESGraphicSystem.h index 5cda56b..1eab619 100644 --- a/LayerManagerPlugins/Renderers/Graphic/include/GraphicSystems/GLESGraphicSystem.h +++ b/LayerManagerPlugins/Renderers/Graphic/include/GraphicSystems/GLESGraphicSystem.h @@ -43,6 +43,8 @@ public: GLESGraphicsystem(int windowHeight, int windowWidth, PfnShaderProgramCreator shaderProgram); + ~GLESGraphicsystem(); + virtual bool init(EGLNativeDisplayType display, EGLNativeWindowType window); virtual void clearBackground(); diff --git a/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp b/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp index b9c492d..4b81179 100644 --- a/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp +++ b/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp @@ -89,6 +89,25 @@ GLESGraphicsystem::GLESGraphicsystem(int windowWidth, int windowHeight, PfnShade } } +GLESGraphicsystem::~GLESGraphicsystem() +{ + LOG_DEBUG("GLESGraphicsystem", "destroying GLESGraphicsystem"); + delete m_defaultShaderClear; + delete m_defaultShader; + delete m_defaultShaderNoBlend; + delete m_defaultShaderNoUniformAlpha; + delete m_defaultShaderAddUniformChromaKey; + delete m_defaultShaderNoUniformAlphaNoBlend; + delete m_defaultShader2surf; + delete m_defaultShader2surfNoBlend; + delete m_defaultShader2surfNoUniformAlpha; + delete m_defaultShader2surfNoUniformAlphaNoBlend; + delete m_defaultShader2surfNoUniformAlpha0; + delete m_defaultShader2surfNoUniformAlpha0NoBlend; + delete m_defaultShader2surfNoUniformAlpha1; + delete m_defaultShader2surfNoUniformAlpha1NoBlend; +} + void GLESGraphicsystem::activateGraphicContext() { eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext); -- 2.7.4