# OpenGL VertexArray Data “Retention”?

After calling glVertexAttribPointer to associate data of the currently bound vertex array with data from the currently bound GL_ARRAY_BUFFER, I mentioned that I can simply delete the used buffer without it affecting the rendering.

What actually happens with the data within the buffer when calling glVertexAttribPointer? It seems like the data from the buffer actually get's copied into another memory location that the vertex array uses.

When you call glVertexAttrib*Pointer, you attach a buffer object to the VAO. The buffer object to be attached is the one bound to GL_ARRAY_BUFFER. Unbinding that buffer, or even flat-out deleting it, will not undo the attachment.