Only flush a display if we have one
authorMatthias Clasen <mclasen@redhat.com>
Fri, 29 Apr 2011 14:31:02 +0000 (10:31 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 29 Apr 2011 19:05:02 +0000 (15:05 -0400)
This was causing occasional segfaults in the gdm session.
https://bugzilla.gnome.org/show_bug.cgi?id=648942

bus/at-spi-bus-launcher.c

index 0d6b4b7..9300979 100644 (file)
@@ -398,11 +398,12 @@ main (int    argc,
         XDeleteProperty (display,
                          XDefaultRootWindow (display),
                          bus_address_atom);
+
+        XFlush (display);
+        XCloseDisplay (display);
       }
-    XFlush (display);
-    XCloseDisplay (display);
   }
-    
+
   if (_global_app->a11y_launch_error_message)
     {
       g_printerr ("Failed to launch bus: %s", _global_app->a11y_launch_error_message);