Skip to content

Commit

Permalink
Merge pull request #57905 from V-Sekai/fix_instance_clear_warnings
Browse files Browse the repository at this point in the history
Free surface vertex_buffers after vertex_arrays to silence warnings
  • Loading branch information
akien-mga authored Feb 15, 2022
2 parents af91a42 + 824ece9 commit 5a6da0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions servers/rendering/renderer_rd/renderer_storage_rd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3578,15 +3578,15 @@ void RendererStorageRD::mesh_instance_set_blend_shape_weight(RID p_mesh_instance

void RendererStorageRD::_mesh_instance_clear(MeshInstance *mi) {
for (uint32_t i = 0; i < mi->surfaces.size(); i++) {
if (mi->surfaces[i].vertex_buffer.is_valid()) {
RD::get_singleton()->free(mi->surfaces[i].vertex_buffer);
}
if (mi->surfaces[i].versions) {
for (uint32_t j = 0; j < mi->surfaces[i].version_count; j++) {
RD::get_singleton()->free(mi->surfaces[i].versions[j].vertex_array);
}
memfree(mi->surfaces[i].versions);
}
if (mi->surfaces[i].vertex_buffer.is_valid()) {
RD::get_singleton()->free(mi->surfaces[i].vertex_buffer);
}
}
mi->surfaces.clear();

Expand Down

0 comments on commit 5a6da0b

Please sign in to comment.