diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-12-05 23:06:19 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-12-05 23:06:19 +0300 |
commit | bca53f09060e8686fe824f0353881ef0671997f8 (patch) | |
tree | 61f4147a44a4f357706aab060dfcefe6f76cfee7 /intern | |
parent | bcd1ab54cd1ebeda433f1c1999f5a9807c808e8e (diff) |
[#20266] Blender starting without X11 segfaults
Abort when ghost x11 cannot initialize a display.
It would just crash later anyway, better to abort with a reasonable error message.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 3f5f52aa2ed..ad8647d2246 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -66,8 +66,10 @@ #include <sys/time.h> #include <unistd.h> +#include <iostream> #include <vector> #include <stdio.h> // for fprintf only +#include <cstdlib> // for exit typedef struct NDOFPlatformInfo { Display *display; @@ -96,7 +98,10 @@ GHOST_SystemX11( { m_display = XOpenDisplay(NULL); - if (!m_display) return; + if (!m_display) { + std::cerr << "Unable to open a display" << std::endl; + abort(); //was return before, but this would just mean it will crash later + } #ifdef __sgi m_delete_window_atom |