kimziv / oglsuperbible5

GLTools and OpenGL SuperBible (5th Edition) OpenGL超级宝典第五版
41 stars 16 forks source link

GLBatch destructor segmentation fault #29

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When GLBatch is declared but not used - its destructor yields a seg fault.

To fix this issue replace in GLBatch::~GLBatch() this:
#ifndef OPENGL_ES
    glDeleteVertexArrays(1, &vertexArrayObject);
#endif

with this:
#ifndef OPENGL_ES
    if(vertexArrayObject != 0) {
        glDeleteVertexArrays(1, &vertexArrayObject);
    }
#endif

Original issue reported on code.google.com by r45...@gmail.com on 23 Jun 2011 at 5:34

GoogleCodeExporter commented 9 years ago
BTW, I'm using Ubuntu 10.10 i386 (and amd64), GeForce 9600GT, Nvidia driver 
v275.09.07, Intel core i5.

There's also other random issues, like ShadedTriangle.cpp in chapter 6 doesn't 
need the ShaderManager, remove obvious comments from all source files (like 
telling that "main" is the program starting point, or that SetupRC() sets up 
the resources, etc), ShutdownRC() doesn't actually get called (at least under 
Linux/Ubuntu), etc, otherwise great book.

Original comment by r45...@gmail.com on 28 Jun 2011 at 11:18