fix segfault crash when DISPLAY is empty (getenv returned null pointer)
This commit is contained in:
parent
77782d24f6
commit
67170488ef
1 changed files with 3 additions and 1 deletions
|
|
@ -266,7 +266,9 @@ bool create_glx_dummy_window(OffscreenContext &ctx)
|
|||
|
||||
ctx.xdisplay = XOpenDisplay(NULL);
|
||||
if (ctx.xdisplay == NULL) {
|
||||
cerr << "Unable to open a connection to the X server (DISPLAY=" << getenv("DISPLAY") << ")\n";
|
||||
cerr << "Unable to open a connection to the X server.\n";
|
||||
char * dpyenv = getenv("DISPLAY");
|
||||
cerr << "DISPLAY=" << (dpyenv?dpyenv:"") << "\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue