Fix lovrBufferDestroy when Buffer is persistent;

This commit is contained in:
bjorn 2018-12-14 15:13:21 -08:00
parent 762cc64e09
commit b34ed206e0
1 changed files with 5 additions and 1 deletions

View File

@ -1523,9 +1523,13 @@ Buffer* lovrBufferCreate(size_t size, void* data, BufferUsage usage, bool readab
void lovrBufferDestroy(void* ref) {
Buffer* buffer = ref;
glDeleteBuffers(1, &buffer->id);
if (buffer->data) {
#ifndef EMSCRIPTEN
if (!GLAD_GL_ARB_buffer_storage) {
#endif
free(buffer->data);
#ifndef EMSCRIPTEN
}
#endif
free(ref);
}