summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2017-06-25 11:23:35 +0300
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2017-06-25 11:30:25 +0300
commit12f8bcae59ed78f23886c0485246a40fb09fe33f (patch)
treee9994e7f6cca9021b646bc03097d8956d84a15b0
parent881f91ef5042c7254262f0e9b302955acdf76fd6 (diff)
Test: check gl API nullity before invoking deletion functions
It happens when OpenGL ES 3.x is not supported. @fix
-rw-r--r--src/bin/elementary/test_glview.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/bin/elementary/test_glview.c b/src/bin/elementary/test_glview.c
index 45d9c84..ce29bd4 100644
--- a/src/bin/elementary/test_glview.c
+++ b/src/bin/elementary/test_glview.c
@@ -179,9 +179,9 @@ make_gear(GLData *gld, GLfloat inner_radius, GLfloat outer_radius, GLfloat width
179static void 179static void
180free_gear(Gear *gear) 180free_gear(Gear *gear)
181{ 181{
182 if (!gear) return;
182 free(gear->vertices); 183 free(gear->vertices);
183 free(gear); 184 free(gear);
184 gear = NULL;
185} 185}
186 186
187static void 187static void
@@ -446,12 +446,15 @@ _del_gl(Evas_Object *obj)
446 } 446 }
447 Evas_GL_API *gl = gld->glapi; 447 Evas_GL_API *gl = gld->glapi;
448 448
449 gl->glDeleteShader(gld->vtx_shader); 449 if (gl)
450 gl->glDeleteShader(gld->fgmt_shader); 450 {
451 gl->glDeleteProgram(gld->program); 451 gl->glDeleteShader(gld->vtx_shader);
452 gl->glDeleteBuffers(1, &gld->gear1->vbo); 452 gl->glDeleteShader(gld->fgmt_shader);
453 gl->glDeleteBuffers(1, &gld->gear2->vbo); 453 gl->glDeleteProgram(gld->program);
454 gl->glDeleteBuffers(1, &gld->gear3->vbo); 454 gl->glDeleteBuffers(1, &gld->gear1->vbo);
455 gl->glDeleteBuffers(1, &gld->gear2->vbo);
456 gl->glDeleteBuffers(1, &gld->gear3->vbo);
457 }
455 458
456 free_gear(gld->gear1); 459 free_gear(gld->gear1);
457 free_gear(gld->gear2); 460 free_gear(gld->gear2);