[Libreoffice-commits] core.git: vcl/opengl

Michael Meeks michael.meeks at collabora.com
Fri Jul 14 09:09:40 UTC 2017


 vcl/opengl/gdiimpl.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 4948a0137992b33c7adfd3d91eb7b0387da11dff
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Wed Apr 19 13:15:03 2017 +0100

    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 at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

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();


More information about the Libreoffice-commits mailing list