diff --git a/examples/OpenGLWindow/GLInstancingRenderer.cpp b/examples/OpenGLWindow/GLInstancingRenderer.cpp index 3754c4a9e..81f9ec8c6 100644 --- a/examples/OpenGLWindow/GLInstancingRenderer.cpp +++ b/examples/OpenGLWindow/GLInstancingRenderer.cpp @@ -397,6 +397,15 @@ void GLInstancingRenderer::removeAllInstances() m_graphicsInstances.clear(); m_data->m_publicGraphicsInstances.exitHandles(); m_data->m_publicGraphicsInstances.initHandles(); + + for (int i=0;im_textureHandles.size();i++) + { + InternalTextureHandle& h = m_data->m_textureHandles[i]; + glDeleteTextures(1, &h.m_glTexture); + } + + m_data->m_textureHandles.clear(); + } GLInstancingRenderer::~GLInstancingRenderer()