Fix a potential SIGSEGV
Compositor::self()->scene() may return nullptr while compositing is being restarted.
This commit is contained in:
parent
cc8cb8db9d
commit
da12d3804f
1 changed files with 6 additions and 2 deletions
|
@ -415,8 +415,12 @@ void Platform::warpPointer(const QPointF &globalPos)
|
|||
|
||||
bool Platform::supportsSurfacelessContext() const
|
||||
{
|
||||
if (Compositor *c = Compositor::self()) {
|
||||
return c->scene()->supportsSurfacelessContext();
|
||||
Compositor *compositor = Compositor::self();
|
||||
if (Q_UNLIKELY(!compositor)) {
|
||||
return false;
|
||||
}
|
||||
if (Scene *scene = compositor->scene()) {
|
||||
return scene->supportsSurfacelessContext();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue