From e3919f268b8aed28796502cb2af6be2e6ea44008 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 22 Nov 2015 18:37:29 +0100 Subject: [PATCH] Fixed: Crash under Linux saying you can't use X in multi-threaded environment --- code/nel/src/3d/driver/opengl/driver_opengl_window.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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 36ac67281..99c0c9cf9 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -350,6 +350,12 @@ bool CDriverGL::init (uintptr_t windowIcon, emptyProc exitFunc) nlunreferenced(windowIcon); + // allow several threads to access X functions + if (XInitThreads() == 0) + { + nlwarning("XInitThreads failed"); + } + _dpy = XOpenDisplay(NULL); if (_dpy == NULL)