wayland: avoid a crash in is_effectively_synchronized()
To check if a subsurface is effectively synchronized, we walk the subsurface hierarchy to look for a non-subsurface parent or a subsurface being synchronized. However, when client is closing, the parent surface might already be gone, in which case we end up with a surface being NULL which causes a NULL pointer dereference and a crash. Check if the parent surface is NULL to avoid the crash, and consider it's already synchronized if it is NULL to avoid further updates. Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/124
This commit is contained in:
parent
2319cd9c40
commit
52fdd24467
1 changed files with 4 additions and 1 deletions
|
@ -573,7 +573,10 @@ meta_wayland_surface_is_effectively_synchronized (MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
MetaWaylandSurface *parent = surface->sub.parent;
|
MetaWaylandSurface *parent = surface->sub.parent;
|
||||||
|
|
||||||
return meta_wayland_surface_is_effectively_synchronized (parent);
|
if (parent)
|
||||||
|
return meta_wayland_surface_is_effectively_synchronized (parent);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue