diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-11-22 16:55:44 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-11-22 17:08:32 +0100 |
commit | 92e9753bd2b851597353603f5fc956460ff88231 (patch) | |
tree | d0bba28376f75d1f241091c93123a9a412fab546 /vcl/source/opengl | |
parent | 74249cb6f4f52b7c10ebaa92f943920f6f94aaf4 (diff) |
fix glx resource leak
Change-Id: I013676d2f4caa0479c917a7f833966be8f0b8009
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index dac3b5c5373f..659570957bdd 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -83,8 +83,8 @@ OpenGLContext::~OpenGLContext() } glXDestroyContext(m_aGLWin.dpy, m_aGLWin.ctx); - if (mbPixmap) - glXDestroyGLXPixmap(m_aGLWin.dpy, m_aGLWin.glPix); + if (mbPixmap && m_aGLWin.glPix != None) + glXDestroyPixmap(m_aGLWin.dpy, m_aGLWin.glPix); } #endif } @@ -613,6 +613,12 @@ void OpenGLContext::resetToReInitialize() if( !mbInitialized ) return; resetCurrent(); + + if (mbPixmap) + { + glXDestroyPixmap(m_aGLWin.dpy, m_aGLWin.glPix); + m_aGLWin.glPix = None; + } mbInitialized = false; } |