From 2daa442d8202c11e2f925991176ae1f6a6a978a6 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 1 Feb 2017 12:00:12 +0100 Subject: Avoid crash in desktop linux with --disable-gpu Don't try to access null OpenGL contexts. Change-Id: I7d0e607e8d29d3cfba8d6e98cd142b951c960281 Reviewed-by: Michal Klocek --- src/core/delegated_frame_node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp index baf064025..b122a3333 100644 --- a/src/core/delegated_frame_node.cpp +++ b/src/core/delegated_frame_node.cpp @@ -454,7 +454,7 @@ DelegatedFrameNode::DelegatedFrameNode() #if defined(USE_X11) && !defined(QT_NO_OPENGL) QOpenGLContext *currentContext = QOpenGLContext::currentContext() ; QOpenGLContext *sharedContext = qt_gl_global_share_context(); - if (!QOpenGLContext::areSharing(currentContext, sharedContext)) { + if (currentContext && sharedContext && !QOpenGLContext::areSharing(currentContext, sharedContext)) { static bool allowNotSharedContextWarningShown = true; if (allowNotSharedContextWarningShown) { allowNotSharedContextWarningShown = false; -- cgit v1.2.3