Commit da12d380 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Fix a potential SIGSEGV

Compositor::self()->scene() may return nullptr while compositing is
being restarted.
parent cc8cb8db
...@@ -415,8 +415,12 @@ void Platform::warpPointer(const QPointF &globalPos) ...@@ -415,8 +415,12 @@ void Platform::warpPointer(const QPointF &globalPos)
bool Platform::supportsSurfacelessContext() const bool Platform::supportsSurfacelessContext() const
{ {
if (Compositor *c = Compositor::self()) { Compositor *compositor = Compositor::self();
return c->scene()->supportsSurfacelessContext(); if (Q_UNLIKELY(!compositor)) {
return false;
}
if (Scene *scene = compositor->scene()) {
return scene->supportsSurfacelessContext();
} }
return false; return false;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment