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
This commit is contained in:
Martin Gräßlin 2014-06-02 07:58:06 +02:00
parent b995c9da23
commit 4c241f0920

View file

@ -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<SceneOpenGL*>(m_scene), &SceneOpenGL::resetCompositing, this, &Compositor::restart);
break; // -->
}
delete m_scene;
m_scene = NULL;
}