Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-12-01 10:15:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-01 10:15:05 +0300
commit8a761a374afb152f0138d01b0a29b180f167263c (patch)
tree6fcd65b0e2a7744afbb6c234ff7ed7ff3e5f33d2 /intern
parentf5f332892cd12a4323650504b33de40f529d2b8a (diff)
quit blender if the first X11 window fails to open.
mainly just to avoid a segfault so the user knows its not a bug.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 60e12ff78df..e8b2f6f7358 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -176,10 +176,21 @@ GHOST_WindowX11(
int attributes[40], i, samples;
Atom atoms[2];
int natom;
- int glxVersionMajor, glxVersionMinor; // As in GLX major.minor
+ int glxVersionMajor, glxVersionMinor; // As in GLX major.mino
+
+ /* initialize incase X11 fails to load */
+ memset(&m_xtablet, 0, sizeof(m_xtablet));
+ m_visual= NULL;
if (!glXQueryVersion(m_display, &glxVersionMajor, &glxVersionMinor)) {
printf("%s:%d: X11 glXQueryVersion() failed, verify working openGL system!\n", __FILE__, __LINE__);
+
+ /* exit if this is the first window */
+ if(s_firstContext==NULL) {
+ printf("initial window could not find the GLX extension, exit!\n");
+ exit(1);
+ }
+
return;
}
@@ -211,6 +222,12 @@ GHOST_WindowX11(
if (samples == 0) {
/* All options exhausted, cannot continue */
printf("%s:%d: X11 glXChooseVisual() failed, verify working openGL system!\n", __FILE__, __LINE__);
+
+ if(s_firstContext==NULL) {
+ printf("initial window could not find the GLX extension, exit!\n");
+ exit(1);
+ }
+
return;
}
} else {
@@ -221,8 +238,6 @@ GHOST_WindowX11(
}
}
- memset(&m_xtablet, 0, sizeof(m_xtablet));
-
// Create a bunch of attributes needed to create an X window.