Skip to content

Commit

Permalink
fix memleak, make sure gl textures are deleted by render thread, than…
Browse files Browse the repository at this point in the history
…ks to popcornmix
  • Loading branch information
FernetMenta committed Sep 26, 2013
1 parent 92b87d5 commit 0f0fc3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xbmc/guilib/TextureGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "windowing/WindowingFactory.h"
#include "utils/log.h"
#include "utils/GLUtils.h"
#include "guilib/TextureManager.h"

#if defined(HAS_GL) || defined(HAS_GLES)

Expand Down Expand Up @@ -50,7 +51,7 @@ void CGLTexture::CreateTextureObject()
void CGLTexture::DestroyTextureObject()
{
if (m_texture)
glDeleteTextures(1, (GLuint*) &m_texture);
g_TextureManager.ReleaseHwTexture(m_texture);
}

void CGLTexture::LoadToGPU()
Expand Down
1 change: 1 addition & 0 deletions xbmc/guilib/TextureManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ void CGUITextureManager::FreeUnusedTextures(unsigned int timeDelay)

void CGUITextureManager::ReleaseHwTexture(unsigned int texture)
{
CSingleLock lock(g_graphicsContext);
m_unusedHwTextures.push_back(texture);
}

Expand Down

0 comments on commit 0f0fc3e

Please sign in to comment.