From 82d25c02f8569aadf166fa92fb581fa68c12fbd1 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 8 Sep 2015 15:57:55 +0100 Subject: tdf#94006 - need an explicit dispose for GLContext's SystemChildWindow. Previously we would get an explicit ~OpenGLContext - and potentially leave FMR's around for other OGC users, now we treat the other users properly - we need an explicit dispose() to get Window::dispose ordering right. Change-Id: I5edcbd73399b6db3dbcfb391570f364f9ab0c70d Reviewed-on: https://gerrit.libreoffice.org/18412 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- vcl/source/opengl/OpenGLContext.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vcl/source/opengl/OpenGLContext.cxx') 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::Create() { return rtl::Reference(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 } -- cgit