Fix crash when PhysicsMaterial asset is reloaded in editor

This commit is contained in:
2024-06-08 19:20:28 +03:00
parent 50c29f6a9b
commit 07371ddfdf
4 changed files with 16 additions and 1 deletions

View File

@@ -4474,6 +4474,16 @@ void PhysicsBackend::DestroyController(void* controller)
controllerPhysX->release();
}
void PhysicsBackend::DestroyMaterial(void* material)
{
ASSERT_LOW_LAYER(material);
auto materialPhysX = (PxMaterial*)material;
materialPhysX->userData = nullptr;
FlushLocker.Lock();
DeleteObjects.Add(materialPhysX);
FlushLocker.Unlock();
}
void PhysicsBackend::DestroyObject(void* object)
{
ASSERT_LOW_LAYER(object);