Merge pull request #17918 from Alexander-Alekseev/shape_bullet_memory_leak_fix

Fix of a possible memory leak in ConcavePolygonShapeBullet::setup
This commit is contained in:
Rémi Verschelde 2018-04-03 12:14:39 +02:00 committed by GitHub
commit f56d0ad92f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -337,10 +337,10 @@ void ConcavePolygonShapeBullet::setup(PoolVector<Vector3> p_faces) {
int src_face_count = faces.size();
if (0 < src_face_count) {
btTriangleMesh *shapeInterface = bulletnew(btTriangleMesh);
// It counts the faces and assert the array contains the correct number of vertices.
ERR_FAIL_COND(src_face_count % 3);
btTriangleMesh *shapeInterface = bulletnew(btTriangleMesh);
src_face_count /= 3;
PoolVector<Vector3>::Read r = p_faces.read();
const Vector3 *facesr = r.ptr();