summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-01-20 12:34:48 +0100
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-01-20 12:35:50 +0100
commit33af00a9ae3136e8aa0fe3183a49681383cd48c7 (patch)
treea8073835eed6ab878e6fe373161f47f79ffe5d90 /vcl
parentb398945d08bdab0de5f22b06c91686569942e668 (diff)
bail out early if there is no Display
Change-Id: I1d724ae9346a4df7207e737cf98bf0cd7293bc2b
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 5df70f44a234..5bd863dfcb44 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -730,6 +730,11 @@ bool OpenGLContext::init(Display* dpy, Pixmap pix, unsigned int width, unsigned
bool OpenGLContext::ImplInit()
{
+ if (!m_aGLWin.dpy)
+ {
+ return false;
+ }
+
GLXContext pSharedCtx( NULL );
#ifdef DBG_UTIL
TempErrorHandler aErrorHandler(m_aGLWin.dpy, unxErrorHandler);
@@ -767,10 +772,10 @@ bool OpenGLContext::ImplInit()
if (!m_aGLWin.ctx)
{
- if (!m_aGLWin.dpy || !m_aGLWin.vi)
+ if (!m_aGLWin.vi)
return false;
- m_aGLWin.ctx = m_aGLWin.dpy == 0 ? 0 : glXCreateContext(m_aGLWin.dpy,
+ m_aGLWin.ctx = glXCreateContext(m_aGLWin.dpy,
m_aGLWin.vi,
pSharedCtx,
GL_TRUE);