1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +00:00

Track mesh dependencies in Dummy RenderingServer to properly resolve freeing MeshInstances

This commit is contained in:
clayjohn
2025-01-31 12:56:16 -08:00
parent 1586c5674b
commit 258d4d5c3d
4 changed files with 60 additions and 46 deletions

View File

@@ -53,13 +53,14 @@ void MeshStorage::mesh_initialize(RID p_rid) {
void MeshStorage::mesh_free(RID p_rid) {
DummyMesh *mesh = mesh_owner.get_or_null(p_rid);
ERR_FAIL_NULL(mesh);
mesh->dependency.deleted_notify(p_rid);
mesh_owner.free(p_rid);
}
void MeshStorage::mesh_surface_remove(RID p_mesh, int p_surface) {
DummyMesh *m = mesh_owner.get_or_null(p_mesh);
ERR_FAIL_NULL(m);
m->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH);
m->surfaces.remove_at(p_surface);
}