Guard subsurface parent access.

Whilst a subsurface must have a parent at the time of creation, the
lifespan is not guaranteed afterwards.

It's a weird thing for a client to do, but we need to not crash
afterwards.

If the parent surface is destroyed we should consider the surface
unmapped.

BUG: 452044
This commit is contained in:
David Edmundson 2022-03-30 14:57:12 +01:00
parent d73bdf2ee2
commit c05e2fea45

View file

@ -690,7 +690,13 @@ void SurfaceInterfacePrivate::commitFromCache()
bool SurfaceInterfacePrivate::computeEffectiveMapped() const
{
return bufferRef && (!subSurface || subSurface->parentSurface()->isMapped());
if (!bufferRef) {
return false;
}
if (subSurface) {
return subSurface->parentSurface() && subSurface->parentSurface()->isMapped();
}
return true;
}
void SurfaceInterfacePrivate::updateEffectiveMapped()