diff options
| author | Alexander Alekseev | 2018-04-02 09:29:34 +0300 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-04-28 20:18:03 +0200 |
| commit | cf3c1d878df88e13eaf1078dbdb0f3380f494399 (patch) | |
| tree | 4dc4a2e984eb6d052226abf1193323716c0cc810 /modules | |
| parent | c5dfe6824c6faf91121cfec14ca960c61c53259e (diff) | |
| download | godot-cf3c1d878df88e13eaf1078dbdb0f3380f494399.tar.gz godot-cf3c1d878df88e13eaf1078dbdb0f3380f494399.tar.zst godot-cf3c1d878df88e13eaf1078dbdb0f3380f494399.zip | |
Fix of a possible memory leak: ConcavePolygonShapeBullet::setup was able to exit without releasing the 'shapeInterface' pointer.
(cherry picked from commit b5692511105cddd812e687259740d2a6fa240219)
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/bullet/shape_bullet.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp index c6b9695d9..d9b91718e 100644 --- a/modules/bullet/shape_bullet.cpp +++ b/modules/bullet/shape_bullet.cpp @@ -335,10 +335,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(); |
