OpenGLTutorial
OpenGLTutorial copied to clipboard
Memory leak in vertex_buffer.h
In VertexBuffer constructor a vertex array object and a buffer are created (Ln. 8/Ln. 11) but the destructor only frees the buffer but not the vao.
https://github.com/Pilzschaf/OpenGLTutorial/blob/b4fe9e7404c1fb18bc93f3e0ac8fb4f6edc73f82/vertex_buffer.h#L8
https://github.com/Pilzschaf/OpenGLTutorial/blob/b4fe9e7404c1fb18bc93f3e0ac8fb4f6edc73f82/vertex_buffer.h#L11
https://github.com/Pilzschaf/OpenGLTutorial/blob/b4fe9e7404c1fb18bc93f3e0ac8fb4f6edc73f82/vertex_buffer.h#L27-L29
Inserting glDeleteVertexArrays(1, &vao); into the destructors code solved the problem for me.