浏览代码

Merge pull request #41040 from qarmin/fixes_leak_bulet

Fixes leak when creating bullet shape
Andrea Catania 5 年之前
父节点
当前提交
8de57bde13
共有 1 个文件被更改,包括 1 次插入0 次删除
  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;
 	}