fix potential memory leak

This commit is contained in:
amzn-sean
2021-04-22 17:22:26 +01:00
parent 8f265f2d3b
commit cd978eaa93
@@ -184,6 +184,7 @@ namespace PhysX
if (sceneInterface == nullptr)
{
AZ_Error("PhysX Ragdoll", false, "Unable to Create Ragdoll, Physics Scene Interface is missing.");
delete ragdoll;
return nullptr;
}
@@ -206,6 +207,7 @@ namespace PhysX
else
{
AZ_Error("PhysX Ragdoll", false, "Failed to create collider shape for ragdoll node %s", nodeConfig.m_debugName.c_str());
delete ragdoll;
return nullptr;
}
}
@@ -287,6 +289,7 @@ namespace PhysX
else
{
AZ_Error("PhysX Ragdoll", false, "Failed to create joint for node index %i.", nodeIndex);
delete ragdoll;
return nullptr;
}
}