summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schuldt <michael.schuldt@bmw.de>2012-12-07 14:29:51 +0200
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>2013-03-27 14:12:10 +0100
commit3c95de645a7adb05c1d6f7f58ce8062e8f2065f1 (patch)
tree61a2aaaa7c3385d4a86ca36d3132cce04e6d6d73
parent19b32f223845b37200a5c2ebb41ef96a5a8b30d4 (diff)
downloadlayer_management-3c95de645a7adb05c1d6f7f58ce8062e8f2065f1.tar.gz
X11EGLImage : Fixing memory leak
- the compostion pixmap handle was not store internal - this causes a memory leak on surface destroy - this is now fixed. Signed-off-by: Michael Schuldt <michael.schuldt@bmw.de>
-rw-r--r--LayerManagerPlugins/Renderers/Graphic/src/TextureBinders/X11EglImage.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/LayerManagerPlugins/Renderers/Graphic/src/TextureBinders/X11EglImage.cpp b/LayerManagerPlugins/Renderers/Graphic/src/TextureBinders/X11EglImage.cpp
index 109fa30..ff15396 100644
--- a/LayerManagerPlugins/Renderers/Graphic/src/TextureBinders/X11EglImage.cpp
+++ b/LayerManagerPlugins/Renderers/Graphic/src/TextureBinders/X11EglImage.cpp
@@ -72,6 +72,8 @@ void X11EglImage::createClientBuffer(Surface* surface)
if (windowPixmap == 0)
{
LOG_ERROR("X11EglImage", "didnt create pixmap!");
+ } else {
+ nativeSurface->pixmap = windowPixmap;
}
EGLImageKHR eglImage = 0;
@@ -114,6 +116,7 @@ PlatformSurface* X11EglImage::createPlatformSurface(Surface* surface)
void X11EglImage::destroyClientBuffer(Surface* surface)
{
EglXPlatformSurface* nativeSurface = (EglXPlatformSurface*)surface->platform;
+ // We have to clean up the gpu texture memory
if (nativeSurface && nativeSurface->eglImage)
{
m_pfEglDestroyImageKHR(m_eglDisplay, nativeSurface->eglImage);
@@ -121,4 +124,10 @@ void X11EglImage::destroyClientBuffer(Surface* surface)
nativeSurface->eglImage = 0;
nativeSurface->texture = 0;
}
+ // We have to clean up the XServer side pixmap too
+ if (nativeSurface && nativeSurface->pixmap )
+ {
+ XFreePixmap(m_x11display, nativeSurface->pixmap);
+ nativeSurface->pixmap = None;
+ }
}