GLESGraphicSystem: release shader resources on destruction
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Mon, 11 Mar 2013 14:54:33 +0000 (07:54 -0700)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Thu, 14 Mar 2013 12:03:39 +0000 (05:03 -0700)
Signed-off-by: Timo Lotterbach <timo.lotterbach@bmw-carit.de>
LayerManagerPlugins/Renderers/Graphic/include/GraphicSystems/GLESGraphicSystem.h
LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp

index 5cda56b..1eab619 100644 (file)
@@ -43,6 +43,8 @@ public:
     GLESGraphicsystem(int windowHeight, int windowWidth,
             PfnShaderProgramCreator shaderProgram);
 
+    ~GLESGraphicsystem();
+
     virtual bool init(EGLNativeDisplayType display, EGLNativeWindowType window);
 
     virtual void clearBackground();
index b9c492d..4b81179 100644 (file)
@@ -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);