Fix thread-local storage memory leak. eglReleaseThread() was leaking some memory because even though it deletes the 'current' thread state, it was inadvertently getting re-allocated when recording the success error state. Change-Id: I92efb1b34e62a21998b4fc19aaeba6473b06548b Reviewed-on: https://swiftshader-review.googlesource.com/11968 Reviewed-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com> Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/OpenGL/libEGL/libEGL.cpp b/src/OpenGL/libEGL/libEGL.cpp index 3a62da0..21ef933 100644 --- a/src/OpenGL/libEGL/libEGL.cpp +++ b/src/OpenGL/libEGL/libEGL.cpp
@@ -488,7 +488,7 @@ detachThread(); - return success(EGL_TRUE); + return EGL_TRUE; // success() is not called here because it would re-allocate thread-local storage. } EGLSurface CreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list)