Fix leaking of Mesh version and lod memory when freeing mesh in GLES3
This commit is contained in:
parent
22a09fef5d
commit
9f708489fa
1 changed files with 15 additions and 0 deletions
|
@ -554,6 +554,21 @@ void MeshStorage::mesh_clear(RID p_mesh) {
|
||||||
glDeleteBuffers(1, &s.index_buffer);
|
glDeleteBuffers(1, &s.index_buffer);
|
||||||
s.index_buffer = 0;
|
s.index_buffer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (s.versions) {
|
||||||
|
memfree(s.versions); //reallocs, so free with memfree.
|
||||||
|
}
|
||||||
|
|
||||||
|
if (s.lod_count) {
|
||||||
|
for (uint32_t j = 0; j < s.lod_count; j++) {
|
||||||
|
if (s.lods[j].index_buffer != 0) {
|
||||||
|
glDeleteBuffers(1, &s.lods[j].index_buffer);
|
||||||
|
s.lods[j].index_buffer = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
memdelete_arr(s.lods);
|
||||||
|
}
|
||||||
|
|
||||||
memdelete(mesh->surfaces[i]);
|
memdelete(mesh->surfaces[i]);
|
||||||
}
|
}
|
||||||
if (mesh->surfaces) {
|
if (mesh->surfaces) {
|
||||||
|
|
Loading…
Reference in a new issue