summaryrefslogtreecommitdiff
path: root/servers/physics_2d/joints_2d_sw.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-28 18:15:02 +0100
committerGitHub <noreply@github.com>2021-02-28 18:15:02 +0100
commit870de12111e2b51bb2a8797c4ea0467b8d9dcb2a (patch)
tree05c6b5e23933f147290a31f69e413bec0e5ba614 /servers/physics_2d/joints_2d_sw.cpp
parent0e77dc6e924cdf68175f56cb67756bf217e6c4ea (diff)
parentfb9d6fcc6d7b9bb7b31997551ee3c47525e790c1 (diff)
Merge pull request #46474 from RootKiller/fix_joints
Fix for crash after joint connected node is set to null
Diffstat (limited to 'servers/physics_2d/joints_2d_sw.cpp')
-rw-r--r--servers/physics_2d/joints_2d_sw.cpp19
1 files changed, 0 insertions, 19 deletions
diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp
index f503868ba5..c7b556deba 100644
--- a/servers/physics_2d/joints_2d_sw.cpp
+++ b/servers/physics_2d/joints_2d_sw.cpp
@@ -205,15 +205,6 @@ PinJoint2DSW::PinJoint2DSW(const Vector2 &p_pos, Body2DSW *p_body_a, Body2DSW *p
}
}
-PinJoint2DSW::~PinJoint2DSW() {
- if (A) {
- A->remove_constraint(this, 0);
- }
- if (B) {
- B->remove_constraint(this, 1);
- }
-}
-
//////////////////////////////////////////////
//////////////////////////////////////////////
//////////////////////////////////////////////
@@ -346,11 +337,6 @@ GrooveJoint2DSW::GrooveJoint2DSW(const Vector2 &p_a_groove1, const Vector2 &p_a_
B->add_constraint(this, 1);
}
-GrooveJoint2DSW::~GrooveJoint2DSW() {
- A->remove_constraint(this, 0);
- B->remove_constraint(this, 1);
-}
-
//////////////////////////////////////////////
//////////////////////////////////////////////
//////////////////////////////////////////////
@@ -442,8 +428,3 @@ DampedSpringJoint2DSW::DampedSpringJoint2DSW(const Vector2 &p_anchor_a, const Ve
A->add_constraint(this, 0);
B->add_constraint(this, 1);
}
-
-DampedSpringJoint2DSW::~DampedSpringJoint2DSW() {
- A->remove_constraint(this, 0);
- B->remove_constraint(this, 1);
-}