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:
parent
d73bdf2ee2
commit
c05e2fea45
1 changed files with 7 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue