mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 22:53:01 +00:00
Prevent possible crash when mesh is freed
This commit is contained in:
parent
09e12ba9b4
commit
3dc1a1dbfb
@ -64,6 +64,8 @@ void MeshStorage::mesh_free(RID p_rid) {
|
||||
mesh_clear(p_rid);
|
||||
mesh_set_shadow_mesh(p_rid, RID());
|
||||
Mesh *mesh = mesh_owner.get_or_null(p_rid);
|
||||
ERR_FAIL_COND(!mesh);
|
||||
|
||||
mesh->dependency.deleted_notify(p_rid);
|
||||
if (mesh->instances.size()) {
|
||||
ERR_PRINT("deleting mesh with active instances");
|
||||
|
@ -210,6 +210,8 @@ void MeshStorage::mesh_free(RID p_rid) {
|
||||
mesh_clear(p_rid);
|
||||
mesh_set_shadow_mesh(p_rid, RID());
|
||||
Mesh *mesh = mesh_owner.get_or_null(p_rid);
|
||||
ERR_FAIL_COND(!mesh);
|
||||
|
||||
mesh->dependency.deleted_notify(p_rid);
|
||||
if (mesh->instances.size()) {
|
||||
ERR_PRINT("deleting mesh with active instances");
|
||||
|
Loading…
Reference in New Issue
Block a user