diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-11-01 09:58:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-01 09:58:48 +0100 |
commit | 629294e8f4581fbf9f4abef3889c69c1daf2cd4f (patch) | |
tree | 6b656594c854fe535cf4a41f43de74562b14c259 /scene | |
parent | 06ecdc1eba8bcb434b5cd5bb51b268ae34399891 (diff) | |
parent | 0a4ceb34d33e9bb4b7e88015ae2b99c235256dd9 (diff) |
Merge pull request #23430 from AndreaCatania/pb_f
Fixed crash on delete physical bone
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/physics_body.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 0fb0869979..13412147ab 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -2326,7 +2326,8 @@ void PhysicalBone::set_joint_type(JointType p_joint_type) { if (p_joint_type == get_joint_type()) return; - memdelete(joint_data); + if (joint_data) + memdelete(joint_data); joint_data = NULL; switch (p_joint_type) { case JOINT_TYPE_PIN: @@ -2526,7 +2527,8 @@ PhysicalBone::PhysicalBone() : } PhysicalBone::~PhysicalBone() { - memdelete(joint_data); + if (joint_data) + memdelete(joint_data); } void PhysicalBone::update_bone_id() { |