Guard access to Display in GLPlatform::getXServerVersion
On wayland OpenGL might get initialized before we have a connection to the XServer and we might only have an xcb connection. So let's guard the access.
This commit is contained in:
parent
820af0ce4a
commit
f1f87c7a7d
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ static qint64 getXServerVersion()
|
|||
qint64 major, minor, patch;
|
||||
|
||||
Display *dpy = display();
|
||||
if (strstr(ServerVendor(dpy), "X.Org")) {
|
||||
if (dpy && strstr(ServerVendor(dpy), "X.Org")) {
|
||||
const int release = VendorRelease(dpy);
|
||||
major = (release / 10000000);
|
||||
minor = (release / 100000) % 100;
|
||||
|
|
Loading…
Reference in a new issue