mirror of https://github.com/bjornbytes/lovr.git
Fix lovrBufferDestroy when Buffer is persistent;
This commit is contained in:
parent
762cc64e09
commit
b34ed206e0
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue