aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/elementary/test_glview.c
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 /src/bin/elementary/test_glview.c
parentevas event grabber: add function to block stacking updates while visible (diff)
downloadefl-12f8bcae59ed78f23886c0485246a40fb09fe33f.tar.gz
Test: check gl API nullity before invoking deletion functions
It happens when OpenGL ES 3.x is not supported. @fix
Diffstat (limited to 'src/bin/elementary/test_glview.c')
-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 45d9c849a7..ce29bd4b48 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
static void
free_gear(Gear *gear)
{
+ if (!gear) return;
free(gear->vertices);
free(gear);
- gear = NULL;
}
static void
@@ -446,12 +446,15 @@ _del_gl(Evas_Object *obj)
}
Evas_GL_API *gl = gld->glapi;
- gl->glDeleteShader(gld->vtx_shader);
- gl->glDeleteShader(gld->fgmt_shader);
- gl->glDeleteProgram(gld->program);
- gl->glDeleteBuffers(1, &gld->gear1->vbo);
- gl->glDeleteBuffers(1, &gld->gear2->vbo);
- gl->glDeleteBuffers(1, &gld->gear3->vbo);
+ if (gl)
+ {
+ gl->glDeleteShader(gld->vtx_shader);
+ gl->glDeleteShader(gld->fgmt_shader);
+ gl->glDeleteProgram(gld->program);
+ gl->glDeleteBuffers(1, &gld->gear1->vbo);
+ gl->glDeleteBuffers(1, &gld->gear2->vbo);
+ gl->glDeleteBuffers(1, &gld->gear3->vbo);
+ }
free_gear(gld->gear1);
free_gear(gld->gear2);