[Mesa-dev] [PATCH] run: stop leaking SSO programs

Timothy Arceri timothy.arceri at collabora.com
Sat Dec 10 00:45:49 UTC 2016


This was causing my poor 8GB laptop to run out on memory.
---
 run.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/run.c b/run.c
index 08fd543..6d635c1 100644
--- a/run.c
+++ b/run.c
@@ -670,7 +670,9 @@ main(int argc, char **argv)
                     text[shader[i].length] = 0;
 
                     const_text = text;
-                    glCreateShaderProgramv(shader[i].type, 1, &const_text);
+                    GLuint prog = glCreateShaderProgramv(shader[i].type, 1,
+                                                         &const_text);
+                    glDeleteProgram(prog);
                 }
             } else if (type == TYPE_CORE || type == TYPE_COMPAT) {
                 GLuint prog = glCreateProgram();
-- 
2.7.4



More information about the mesa-dev mailing list