Add id check when disposing ebo and vbo

This commit is contained in:
Linloir 2022-12-13 10:12:57 +08:00
parent 58593822a3
commit e02160435a
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366
2 changed files with 2 additions and 0 deletions

View File

@ -44,6 +44,7 @@ inline void ElementBufferObject::unbind() const {
}
inline void ElementBufferObject::dispose() {
if (_id == 0) return;
OPENGL_EXTRA_FUNCTIONS->glDeleteBuffers(1, &_id);
_id = 0;
}

View File

@ -44,6 +44,7 @@ inline void VertexBufferObject::unbind() const {
}
inline void VertexBufferObject::dispose() {
if (_id == 0) return;
OPENGL_EXTRA_FUNCTIONS->glDeleteBuffers(1, &_id);
_id = 0;
}