Changeset 672


Ignore:
Timestamp:
Feb 20, 2011, 1:02:56 PM (9 years ago)
Author:
sam
Message:

Fix a memory leak in the vertex array buffer handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scene.cpp

    r671 r672  
    6262    float angle;
    6363
     64#if LOL_EXPERIMENTAL
     65    GLuint vao;
     66#endif
    6467    GLuint *bufs;
    6568    int nbufs;
     
    8386    data->bufs = 0;
    8487    data->nbufs = 0;
     88
     89#if LOL_EXPERIMENTAL
     90    glGenVertexArrays(1, &data->vao);
     91#endif
    8592}
    8693
     
    9097     * Change the architecture to make sure of that. */
    9198    glDeleteBuffers(data->nbufs, data->bufs);
     99#if LOL_EXPERIMENTAL
     100    glDeleteVertexArrays(1, &data->vao);
     101#endif
    92102    free(data->bufs);
    93103    delete data;
     
    201211
    202212#if LOL_EXPERIMENTAL
    203         GLuint vao;
    204 
    205         glGenVertexArrays(1, &vao);
    206         glBindVertexArray(vao);
     213        glBindVertexArray(data->vao);
    207214#else
    208215        glEnableClientState(GL_VERTEX_ARRAY);
Note: See TracChangeset for help on using the changeset viewer.