x11: don't try and close a NULL display

If we failed to open an X display then don't later try and close a NULL
display resulting in a crash.
This commit is contained in:
Robert Bragg 2011-07-19 19:46:37 +01:00
parent 8b34a39319
commit 1144a05bfd

View File

@ -181,7 +181,7 @@ _cogl_xlib_renderer_disconnect (CoglRenderer *renderer)
{
CoglXlibRenderer *xlib_renderer = renderer->winsys;
if (!renderer->foreign_xdpy)
if (!renderer->foreign_xdpy && xlib_renderer->xdpy)
XCloseDisplay (xlib_renderer->xdpy);
unregister_xlib_renderer (renderer);