summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2017-04-19 13:15:03 +0100
committerMichael Meeks <michael.meeks@collabora.com>2017-07-14 11:09:08 +0200
commit4948a0137992b33c7adfd3d91eb7b0387da11dff (patch)
tree555ff32a938b47c33b1bd30b555ba9adb842fa1e /vcl
parentefbf75b844f73d25414da3136aeeecafa40c47d1 (diff)
vcl: If we fail to create an OpenGLContext for a window - don't crash.
Change-Id: I362724911ac60df7ac699495bac852be9e7c6b13 Reviewed-on: https://gerrit.libreoffice.org/36684 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/opengl/gdiimpl.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 80ba872b4fc5..342a8028cd01 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -2103,6 +2103,15 @@ void OpenGLSalGraphicsImpl::doFlush()
assert( mpWindowContext.is() );
+ if( !mpWindowContext.is() )
+ {
+ // failed to create a GL context for this window:
+ // eg. mis-matching pixel formats, underlying window
+ // resource lifecycle, etc.
+ VCL_GL_INFO( "Failed to create window context" );
+ return;
+ }
+
// Interesting ! -> this destroys a context [ somehow ] ...
mpWindowContext->makeCurrent();
CHECK_GL_ERROR();