diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2013-09-26 13:17:04 +0200 |
---|---|---|
committer | Rainer Hochecker <fernetmenta@online.de> | 2013-09-26 13:18:32 +0200 |
commit | 0f0fc3e0e94fa03a56606ffa949fdbf8ff3d58c6 (patch) | |
tree | 958b831e824f0409c8053e763a16672f8338989d | |
parent | 92b87d56695ebb1865ab8a57c4de9faf462d91e7 (diff) |
fix memleak, make sure gl textures are deleted by render thread, thanks to popcornmix
-rw-r--r-- | xbmc/guilib/TextureGL.cpp | 3 | ||||
-rw-r--r-- | xbmc/guilib/TextureManager.cpp | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/xbmc/guilib/TextureGL.cpp b/xbmc/guilib/TextureGL.cpp index 2bce969ef4..97da5e2810 100644 --- a/xbmc/guilib/TextureGL.cpp +++ b/xbmc/guilib/TextureGL.cpp @@ -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) @@ -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() diff --git a/xbmc/guilib/TextureManager.cpp b/xbmc/guilib/TextureManager.cpp index 18257d5a47..eff53151a8 100644 --- a/xbmc/guilib/TextureManager.cpp +++ b/xbmc/guilib/TextureManager.cpp @@ -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); } |