Merge pull request #23430 from AndreaCatania/pb_f

Fixed crash on delete physical bone
This commit is contained in:
Rémi Verschelde 2018-11-01 09:58:48 +01:00 committed by GitHub
commit 629294e8f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2326,6 +2326,7 @@ void PhysicalBone::set_joint_type(JointType p_joint_type) {
if (p_joint_type == get_joint_type())
return;
if (joint_data)
memdelete(joint_data);
joint_data = NULL;
switch (p_joint_type) {
@ -2526,6 +2527,7 @@ PhysicalBone::PhysicalBone() :
}
PhysicalBone::~PhysicalBone() {
if (joint_data)
memdelete(joint_data);
}