mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
wayland: do not crash if the surface is gone
If a queued event is being processed after the surface is destroyed, trying to access the window associated with the surface will lead to a segmentation fault. This patch avoids the crash by first checking if the surface is not null. https://bugzilla.gnome.org/show_bug.cgi?id=754715
This commit is contained in:
parent
5066eaf691
commit
443d579d40
@ -293,8 +293,12 @@ static MetaWindow *
|
|||||||
meta_surface_actor_wayland_get_window (MetaSurfaceActor *actor)
|
meta_surface_actor_wayland_get_window (MetaSurfaceActor *actor)
|
||||||
{
|
{
|
||||||
MetaSurfaceActorWaylandPrivate *priv = meta_surface_actor_wayland_get_instance_private (META_SURFACE_ACTOR_WAYLAND (actor));
|
MetaSurfaceActorWaylandPrivate *priv = meta_surface_actor_wayland_get_instance_private (META_SURFACE_ACTOR_WAYLAND (actor));
|
||||||
|
MetaWaylandSurface *surface = priv->surface;
|
||||||
|
|
||||||
return priv->surface->window;
|
if (!surface)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return surface->window;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user