Browse Source

Fixes leak when creating bullet shape

Rafał Mikrut 5 years ago
parent
commit
ac1b2da96e
1 changed files with 1 additions and 0 deletions
  1. 1 0
      modules/bullet/space_bullet.cpp

+ 1 - 0
modules/bullet/space_bullet.cpp

@@ -177,6 +177,7 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf
 	bt_xform_to.getOrigin() += bt_motion;
 
 	if ((bt_xform_to.getOrigin() - bt_xform_from.getOrigin()).fuzzyZero()) {
+		shape->destroy_bt_shape(btShape);
 		return false;
 	}