소스 검색

Merge pull request #22841 from J08nY/fix/collision-object-macro

Fix multi-statement macro call not being covered.
Rémi Verschelde 7 년 전
부모
커밋
0063ba9207
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 3
      modules/bullet/bullet_utilities.h
  2. 2 1
      modules/bullet/collision_object_bullet.cpp

+ 4 - 3
modules/bullet/bullet_utilities.h

@@ -39,7 +39,8 @@
 	new cl
 	new cl
 
 
 #define bulletdelete(cl) \
 #define bulletdelete(cl) \
-	delete cl;           \
-	cl = NULL;
-
+	{                    \
+		delete cl;       \
+		cl = NULL;       \
+	}
 #endif
 #endif

+ 2 - 1
modules/bullet/collision_object_bullet.cpp

@@ -310,9 +310,10 @@ void RigidCollisionObjectBullet::shape_changed(int p_shape_index) {
 
 
 void RigidCollisionObjectBullet::reload_shapes() {
 void RigidCollisionObjectBullet::reload_shapes() {
 
 
-	if (mainShape && mainShape->isCompound())
+	if (mainShape && mainShape->isCompound()) {
 		// Destroy compound
 		// Destroy compound
 		bulletdelete(mainShape);
 		bulletdelete(mainShape);
+	}
 
 
 	mainShape = NULL;
 	mainShape = NULL;