From cae90bb035e6170a9beb38545cf60e31af612804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 21 Dec 2015 00:18:00 +0100 Subject: [PATCH] catch nullptr effects when deleting shadows the shadow can be deleted deferred from an update there's a slight chance, to be eg. triggered by clients blocking compositing, that the compositor is suspended in the same cycle and the effects pointer (and scene and context) thus gone CCBUG: 356938 FIXED-IN: 5.6 REVIEW: 126441 --- scene_opengl.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 85a3838d93..c81c2b8905 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -2195,9 +2195,11 @@ SceneOpenGLShadow::SceneOpenGLShadow(Toplevel *toplevel) SceneOpenGLShadow::~SceneOpenGLShadow() { - effects->makeOpenGLContextCurrent(); - DecorationShadowTextureCache::instance().unregister(this); - m_texture.reset(); + if (effects) { + effects->makeOpenGLContextCurrent(); + DecorationShadowTextureCache::instance().unregister(this); + m_texture.reset(); + } } void SceneOpenGLShadow::buildQuads()