From 4c241f092018804a150c1debf36f90eaf6955bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 2 Jun 2014 07:58:06 +0200 Subject: [PATCH] Only connect the Scene::resetCompositing signal when Scene got constructed SceneOpenGL::createScene() might return a null pointer and in this case we should not try to connect to it. REVIEW: 118462 --- composite.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/composite.cpp b/composite.cpp index f0d680f29b..d0a1947aae 100644 --- a/composite.cpp +++ b/composite.cpp @@ -213,14 +213,15 @@ void Compositor::slotCompositingOptionsInitialized() #endif m_scene = SceneOpenGL::createScene(); - connect(m_scene, SIGNAL(resetCompositing()), SLOT(restart())); // TODO: Add 30 second delay to protect against screen freezes as well unsafeConfig.writeEntry(openGLIsUnsafe, false); unsafeConfig.sync(); - if (m_scene && !m_scene->initFailed()) + if (m_scene && !m_scene->initFailed()) { + connect(static_cast(m_scene), &SceneOpenGL::resetCompositing, this, &Compositor::restart); break; // --> + } delete m_scene; m_scene = NULL; }