From 023510636c74decc278074318f8732edf7b879fa Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 22 Jul 2010 16:58:23 +0100 Subject: [PATCH] Plug the leaking CoglProgram and CoglShader _cogl_program_free and _cogl_shader_free never freed the struct their structs so it would end up leaking a little bit. --- cogl/driver/gl/cogl-program.c | 2 ++ cogl/driver/gl/cogl-shader.c | 2 ++ cogl/driver/gles/cogl-program.c | 2 ++ cogl/driver/gles/cogl-shader.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/cogl/driver/gl/cogl-program.c b/cogl/driver/gl/cogl-program.c index a51e4cf22..bf630adc8 100644 --- a/cogl/driver/gl/cogl-program.c +++ b/cogl/driver/gl/cogl-program.c @@ -74,6 +74,8 @@ _cogl_program_free (CoglProgram *program) released! Do that separately before this! */ _COGL_GET_CONTEXT (ctx, NO_RETVAL); GE (glDeleteProgram (program->gl_handle)); + + g_slice_free (CoglProgram, program); } CoglHandle diff --git a/cogl/driver/gl/cogl-shader.c b/cogl/driver/gl/cogl-shader.c index 50c4f9687..8c072851e 100644 --- a/cogl/driver/gl/cogl-shader.c +++ b/cogl/driver/gl/cogl-shader.c @@ -52,6 +52,8 @@ _cogl_shader_free (CoglShader *shader) released! Do that separately before this! */ _COGL_GET_CONTEXT (ctx, NO_RETVAL); glDeleteShader (shader->gl_handle); + + g_slice_free (CoglShader, shader); } CoglHandle diff --git a/cogl/driver/gles/cogl-program.c b/cogl/driver/gles/cogl-program.c index c28dbfada..22450619b 100644 --- a/cogl/driver/gles/cogl-program.c +++ b/cogl/driver/gles/cogl-program.c @@ -66,6 +66,8 @@ _cogl_program_free (CoglProgram *program) for (i = 0; i < COGL_GLES2_NUM_CUSTOM_UNIFORMS; i++) if (program->custom_uniform_names[i]) g_free (program->custom_uniform_names[i]); + + g_slice_free (CoglProgram, program); } CoglHandle diff --git a/cogl/driver/gles/cogl-shader.c b/cogl/driver/gles/cogl-shader.c index c2e1114f6..5b2214e3d 100644 --- a/cogl/driver/gles/cogl-shader.c +++ b/cogl/driver/gles/cogl-shader.c @@ -46,6 +46,8 @@ _cogl_shader_free (CoglShader *shader) released! Do that separately before this! */ _COGL_GET_CONTEXT (ctx, NO_RETVAL); glDeleteShader (shader->gl_handle); + + g_slice_free (CoglShader, shader); } CoglHandle