diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 9514d938f..171214384 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -501,8 +501,11 @@ bool CDriverGL::unInit() // restore default X errors handler XSetErrorHandler(NULL); - XCloseDisplay(_dpy); - _dpy = NULL; + if (_dpy) + { + XCloseDisplay(_dpy); + _dpy = NULL; + } #endif // NL_OS_UNIX