summaryrefslogtreecommitdiff
path: root/vcl/opengl/gdiimpl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/opengl/gdiimpl.cxx')
-rw-r--r--vcl/opengl/gdiimpl.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 85c3a3a1ab13..37b21f36edc1 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -115,7 +115,8 @@ void OpenGLSalGraphicsImpl::Init()
// check if we can simply re-use the same context
if( mpContext.is() )
{
- if( !UseContext( mpContext ) )
+ if( !mpContext->isInitialized() ||
+ !UseContext( mpContext ) )
ReleaseContext();
}
@@ -124,8 +125,12 @@ void OpenGLSalGraphicsImpl::Init()
maOffscreenTex.GetWidth() != GetWidth() ||
maOffscreenTex.GetHeight() != GetHeight() )
{
- if( mpContext.is() ) // valid context
+ if( maOffscreenTex && // don't work to release empty textures
+ mpContext.is() ) // valid context
+ {
+ mpContext->makeCurrent();
mpContext->ReleaseFramebuffer( maOffscreenTex );
+ }
maOffscreenTex = OpenGLTexture();
}
}