diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-05-19 14:59:33 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-05-29 09:08:33 +0000 |
commit | eb533c18d91cefc5ba455f53a907a614037333f2 (patch) | |
tree | 9a3e7fd4bd6468d24fe3f6695049e8fc73e584cd | |
parent | 64a79a104ded96a5ecc092a38ca4a6a58ee85be5 (diff) | |
download | qtwebkit-eb533c18d91cefc5ba455f53a907a614037333f2.tar.gz |
Fix another potential OpenGL crash on exit
Now that the QOpenGLContext is watched and set to 0 if deleted, we
might have a private class, but no context on deletion, we must
therefore test the pointer before trying to make it active to do the
final cleanups.
Change-Id: Ie970265adfba5d0405a02a157bee344665d2092f
Reviewed-by: Yohan Chuzeville <ychuzevi@cisco.com>
Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
-rw-r--r-- | Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp index dffcfc637..43b546d18 100644 --- a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp +++ b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp @@ -383,6 +383,8 @@ void GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext() bool GraphicsContext3DPrivate::makeCurrentIfNeeded() const { + if (!m_platformContext) + return false; const QOpenGLContext* currentContext = QOpenGLContext::currentContext(); if (currentContext == m_platformContext) return true; @@ -424,6 +426,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWi , m_multisampleFBO(0) , m_multisampleDepthStencilBuffer(0) , m_multisampleColorBuffer(0) + , m_functions(0) , m_private(adoptPtr(new GraphicsContext3DPrivate(this, hostWindow, renderStyle))) , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT) { |