[mutter] wayland-stage: Fix a race condition early in init



commit 3c0ca1f2afe05191af9de0d1ee84b606233403d7
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Apr 22 10:24:11 2014 -0400

    wayland-stage: Fix a race condition early in init
    
    If Xwayland takes too long to start up, Clutter can choose to draw, at
    which point we'll crash because the MetaDisplay hasn't initialized yet.

 src/wayland/meta-wayland-stage.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-stage.c b/src/wayland/meta-wayland-stage.c
index 97c2647..39e41ab 100644
--- a/src/wayland/meta-wayland-stage.c
+++ b/src/wayland/meta-wayland-stage.c
@@ -36,6 +36,10 @@ meta_wayland_stage_paint (ClutterActor *actor)
 
   CLUTTER_ACTOR_CLASS (meta_wayland_stage_parent_class)->paint (actor);
 
+  /* Early in initialization, we can hit this. */
+  if (!display)
+    return;
+
   tracker = meta_cursor_tracker_get_for_screen (display->screen);
 
   if (tracker)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]