From 1144a05bfd57e925ef4280b7c0272cb2aed34689 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Tue, 19 Jul 2011 19:46:37 +0100 Subject: [PATCH] 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. --- cogl/cogl-xlib-renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogl/cogl-xlib-renderer.c b/cogl/cogl-xlib-renderer.c index 03a822bc1..8b4d3ccc1 100644 --- a/cogl/cogl-xlib-renderer.c +++ b/cogl/cogl-xlib-renderer.c @@ -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);