summaryrefslogtreecommitdiff
path: root/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/EGL/egl.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 8977fbf5ec..3d5a4d16f6 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -22,7 +22,7 @@
#include <sys/ioctl.h>
-#if HAVE_ANDROID_OS
+#ifdef HAVE_ANDROID_OS
#include <linux/android_pmem.h>
#endif
@@ -389,10 +389,9 @@ static tls_t* getTLS()
}
static inline void clearError() {
- if (gEGLThreadLocalStorageKey != -1) {
- tls_t* tls = getTLS();
- tls->error = EGL_SUCCESS;
- }
+ // This must clear the error from all the underlying EGL implementations as
+ // well as the EGL wrapper layer.
+ eglGetError();
}
template<typename T>