Fix of a possible memory leak: ConcavePolygonShapeBullet::setup was able to exit without releasing the 'shapeInterface' pointer.

(cherry picked from commit b569251110)
This commit is contained in:
Alexander Alekseev 2018-04-02 09:29:34 +03:00 committed by Hein-Pieter van Braam
parent c5dfe6824c
commit cf3c1d878d
1 changed files with 2 additions and 2 deletions

View File

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