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

Fix multi-statement macro call not being covered.
This commit is contained in:
Rémi Verschelde 2018-10-08 13:30:25 +02:00 committed by GitHub
commit 0063ba9207
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

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

View File

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