[wayland] Do not start composite timer if Workspace is not ready yet

Could cause a race during startup resulting in crash.
This commit is contained in:
Martin Gräßlin 2015-03-18 16:27:22 +01:00
parent 8b8167b565
commit 862bb95ffb

View file

@ -744,6 +744,9 @@ void Compositor::setCompositeTimer()
{ {
if (!hasScene()) // should not really happen, but there may be e.g. some damage events still pending if (!hasScene()) // should not really happen, but there may be e.g. some damage events still pending
return; return;
if (!Workspace::self()) {
return;
}
// Don't start the timer if we're waiting for a swap event // Don't start the timer if we're waiting for a swap event
if (m_bufferSwapPending && m_composeAtSwapCompletion) if (m_bufferSwapPending && m_composeAtSwapCompletion)