summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-12-04 08:05:33 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-12-04 08:09:43 +0100
commit85c8428797cfb047fea790e48e5a3260fcb83cc5 (patch)
treefbd68b2b9beee9fc5890a2374c881b4e62c8c9d0
parent8e70b5bb89255e9ad5bb1f098d931c629b3343c2 (diff)
add assert to detect double delete
Change-Id: I13427cb698d29adb1d19b135ada91bcdfc8b8c92
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index b0bc91d8d435..3a7a1fb3f169 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -97,7 +97,9 @@ OpenGLContext::~OpenGLContext()
#if defined( WNT )
if (m_aGLWin.hRC)
{
- vShareList.erase(std::remove(vShareList.begin(), vShareList.end(), m_aGLWin.hRC));
+ std::vector<HGLRC>::const_iterator itr = std::remove(vShareList.begin(), vShareList.end(), m_aGLWin.hRC);
+ assert(itr != vShareList.end());
+ vShareList.erase(itr);
wglMakeCurrent( m_aGLWin.hDC, 0 );
wglDeleteContext( m_aGLWin.hRC );