Browse Source

Merge pull request #61311 from trollodel/fix_joint3d_warning_crash

Rémi Verschelde 3 years ago
parent
commit
d3268c51ad
2 changed files with 2 additions and 2 deletions
  1. 1 1
      scene/2d/joint_2d.cpp
  2. 1 1
      scene/3d/joint_3d.cpp

+ 1 - 1
scene/2d/joint_2d.cpp

@@ -50,6 +50,7 @@ void Joint2D::_disconnect_signals() {
 void Joint2D::_body_exit_tree() {
 	_disconnect_signals();
 	_update_joint(true);
+	update_configuration_warnings();
 }
 
 void Joint2D::_update_joint(bool p_only_free) {
@@ -64,7 +65,6 @@ void Joint2D::_update_joint(bool p_only_free) {
 	if (p_only_free || !is_inside_tree()) {
 		PhysicsServer2D::get_singleton()->joint_clear(joint);
 		warning = String();
-		update_configuration_warnings();
 		return;
 	}
 

+ 1 - 1
scene/3d/joint_3d.cpp

@@ -49,6 +49,7 @@ void Joint3D::_disconnect_signals() {
 void Joint3D::_body_exit_tree() {
 	_disconnect_signals();
 	_update_joint(true);
+	update_configuration_warnings();
 }
 
 void Joint3D::_update_joint(bool p_only_free) {
@@ -65,7 +66,6 @@ void Joint3D::_update_joint(bool p_only_free) {
 	if (p_only_free || !is_inside_tree()) {
 		PhysicsServer3D::get_singleton()->joint_clear(joint);
 		warning = String();
-		update_configuration_warnings();
 		return;
 	}