From eca92de29c5a9048f4b15c5f9aa96b7ad8235b49 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 28 Oct 2015 17:04:51 +0100 Subject: fix frequent deadlocks on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With a desktop OpenGL build of Qt we encountered frequent deadlocks when creating OpenGL contexts. Initialize the context directly on the calling thread instead of the browser thread and do not synchronize with the browser thread. Task-number: QTBUG-48276 Change-Id: I0970c66cb230881cdc53f22d4a255ea08e6fe63a Reviewed-by: Michael BrĂ¼ning Reviewed-by: Allan Sandfeld Jensen --- src/core/gl_context_qt.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/core/gl_context_qt.cpp') diff --git a/src/core/gl_context_qt.cpp b/src/core/gl_context_qt.cpp index b350c3c5b..3a6de6935 100644 --- a/src/core/gl_context_qt.cpp +++ b/src/core/gl_context_qt.cpp @@ -146,10 +146,16 @@ scoped_refptr GLContext::CreateGLContext(GLShareGroup* share_group, G { #if defined(OS_WIN) scoped_refptr context; - if (GetGLImplementation() == kGLImplementationDesktopGL) + if (GetGLImplementation() == kGLImplementationDesktopGL) { context = new GLContextWGL(share_group); - else + if (!context->Initialize(compatible_surface, gpu_preference)) { + delete context; + return nullptr; + } + return context; + } else { context = new GLContextEGL(share_group); + } #else scoped_refptr context = new GLContextEGL(share_group); #endif -- cgit v1.2.3