Fixed: Crash under Linux saying you can't use X in multi-threaded environment

This commit is contained in:
kervala 2015-11-22 18:37:29 +01:00
parent e618275bec
commit 2d348c7f13

View file

@ -350,6 +350,12 @@ bool CDriverGL::init (uintptr_t windowIcon, emptyProc exitFunc)
nlunreferenced(windowIcon); nlunreferenced(windowIcon);
// allow several threads to access X functions
if (XInitThreads() == 0)
{
nlwarning("XInitThreads failed");
}
_dpy = XOpenDisplay(NULL); _dpy = XOpenDisplay(NULL);
if (_dpy == NULL) if (_dpy == NULL)