Skip to content

Commit

Permalink
Fix memory leak in EGL / GUI mode, resetSimulation with textures in G…
Browse files Browse the repository at this point in the history
…UI mode.

Fixes Issue bulletphysics#3285
  • Loading branch information
erwincoumans committed Mar 4, 2021
1 parent adcaa75 commit 3963f07
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/OpenGLWindow/GLInstancingRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,15 @@ void GLInstancingRenderer::removeAllInstances()
m_graphicsInstances.clear();
m_data->m_publicGraphicsInstances.exitHandles();
m_data->m_publicGraphicsInstances.initHandles();

for (int i=0;i<m_data->m_textureHandles.size();i++)
{
InternalTextureHandle& h = m_data->m_textureHandles[i];
glDeleteTextures(1, &h.m_glTexture);
}

m_data->m_textureHandles.clear();

}

GLInstancingRenderer::~GLInstancingRenderer()
Expand Down

0 comments on commit 3963f07

Please sign in to comment.