From 49cadc88bbec342e39654165858c99df73564e89 Mon Sep 17 00:00:00 2001 From: raster Date: Wed, 25 Aug 2010 13:41:03 +0000 Subject: [PATCH] and fail init of gl cleanly again... :) git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@51644 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/modules/engines/gl_common/evas_gl_context.c | 17 ++++++++++------- src/modules/engines/gl_common/evas_gl_shader.c | 3 +++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/modules/engines/gl_common/evas_gl_context.c b/src/modules/engines/gl_common/evas_gl_context.c index d6a7001..02ba5c0 100644 --- a/src/modules/engines/gl_common/evas_gl_context.c +++ b/src/modules/engines/gl_common/evas_gl_context.c @@ -659,14 +659,17 @@ evas_gl_common_context_free(Evas_GL_Context *gc) if (gc->shared) gc->shared->references--; if (gc->def_surface) evas_gl_common_image_free(gc->def_surface); - - for (i = 0; i < gc->shared->info.pipes_max; i++) + + if (gc->shared) { - if (gc->pipe[i].array.vertex) free(gc->pipe[i].array.vertex); - if (gc->pipe[i].array.color) free(gc->pipe[i].array.color); - if (gc->pipe[i].array.texuv) free(gc->pipe[i].array.texuv); - if (gc->pipe[i].array.texuv2) free(gc->pipe[i].array.texuv2); - if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3); + for (i = 0; i < gc->shared->info.pipes_max; i++) + { + if (gc->pipe[i].array.vertex) free(gc->pipe[i].array.vertex); + if (gc->pipe[i].array.color) free(gc->pipe[i].array.color); + if (gc->pipe[i].array.texuv) free(gc->pipe[i].array.texuv); + if (gc->pipe[i].array.texuv2) free(gc->pipe[i].array.texuv2); + if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3); + } } if ((gc->shared) && (gc->shared->references == 0)) diff --git a/src/modules/engines/gl_common/evas_gl_shader.c b/src/modules/engines/gl_common/evas_gl_shader.c index a2043bf..1f1fe5e 100644 --- a/src/modules/engines/gl_common/evas_gl_shader.c +++ b/src/modules/engines/gl_common/evas_gl_shader.c @@ -441,6 +441,7 @@ evas_gl_common_shader_program_init(Evas_GL_Program *p, GLERR(__FUNCTION__, __FILE__, __LINE__, ""); glCompileShader(p->vert); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + ok = 0; glGetShaderiv(p->vert, GL_COMPILE_STATUS, &ok); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); if (!ok) @@ -454,6 +455,7 @@ evas_gl_common_shader_program_init(Evas_GL_Program *p, GLERR(__FUNCTION__, __FILE__, __LINE__, ""); glCompileShader(p->frag); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + ok = 0; glGetShaderiv(p->frag, GL_COMPILE_STATUS, &ok); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); if (!ok) @@ -482,6 +484,7 @@ evas_gl_common_shader_program_init(Evas_GL_Program *p, glLinkProgram(p->prog); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); + ok = 0; glGetProgramiv(p->prog, GL_LINK_STATUS, &ok); GLERR(__FUNCTION__, __FILE__, __LINE__, ""); if (!ok) -- 2.7.4