diff options
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 432241f03817..f65341a4cbfd 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -112,6 +112,13 @@ OpenGLContext::~OpenGLContext() assert (mnRefCount == 1); } +// release associated child-window if we have one +void OpenGLContext::dispose() +{ + reset(); + m_pChildWindow.disposeAndClear(); +} + rtl::Reference<OpenGLContext> OpenGLContext::Create() { return rtl::Reference<OpenGLContext>(new OpenGLContext); @@ -1191,6 +1198,7 @@ void OpenGLContext::reset() wglMakeCurrent(NULL, NULL); wglDeleteContext( m_aGLWin.hRC ); ReleaseDC( m_aGLWin.hWnd, m_aGLWin.hDC ); + m_aGLWin.hRC = 0; } #elif defined( MACOSX ) OpenGLWrapper::resetCurrent(); @@ -1212,6 +1220,7 @@ void OpenGLContext::reset() if (mbPixmap && m_aGLWin.glPix != None) glXDestroyPixmap(m_aGLWin.dpy, m_aGLWin.glPix); + m_aGLWin.ctx = 0; } #endif } |