Check the EGL error before calling eglTerminate().
authorSamuel Rødal <samuel.rodal@digia.com>
Thu, 25 Oct 2012 12:36:45 +0000 (14:36 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 26 Oct 2012 20:39:30 +0000 (22:39 +0200)
Otherwise we always get EGL_SUCCESS, which is not very informative.

Change-Id: I25311c14108ae385913aa9dc159a1f5fad142342
Reviewed-by: Rainer Keller <rainer.keller@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
src/plugins/platforms/eglfs/qeglfswindow.cpp

index 036b26a..32d20e6 100644 (file)
@@ -89,8 +89,9 @@ void QEglFSWindow::create()
     m_window = hooks->createNativeWindow(hooks->screenSize(), m_format);
     m_surface = eglCreateWindowSurface(display, config, m_window, NULL);
     if (m_surface == EGL_NO_SURFACE) {
+        EGLint error = eglGetError();
         eglTerminate(display);
-        qFatal("EGL Error : Could not create the egl surface: error = 0x%x\n", eglGetError());
+        qFatal("EGL Error : Could not create the egl surface: error = 0x%x\n", error);
     }
 }