diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-03-03 15:06:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-03 15:06:34 +0100 |
commit | cbb4fe45d039ad16abe992d2212011c260d6ac17 (patch) | |
tree | 0fede6f8b5e0e6300c1f03de1aeb3ddb6a9ef5e1 /thirdparty/b2d_convexdecomp/b2Polygon.cpp | |
parent | 973d4753a287306706dc2535958771074941bb7e (diff) | |
parent | 7c0da76402a6b53237ecec34757f686d2fac642b (diff) |
Merge pull request #17035 from Chaosus/fixleaks
Fix memory leaks
Diffstat (limited to 'thirdparty/b2d_convexdecomp/b2Polygon.cpp')
-rw-r--r-- | thirdparty/b2d_convexdecomp/b2Polygon.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/thirdparty/b2d_convexdecomp/b2Polygon.cpp b/thirdparty/b2d_convexdecomp/b2Polygon.cpp index b6ead62c63..c80204ae21 100644 --- a/thirdparty/b2d_convexdecomp/b2Polygon.cpp +++ b/thirdparty/b2d_convexdecomp/b2Polygon.cpp @@ -1342,7 +1342,12 @@ b2Polygon TraceEdge(b2Polygon* p){ if (nodes[j].nConnected == 0) continue; b2Vec2 diff = nodes[i].position - nodes[j].position; if (diff.LengthSquared() <= COLLAPSE_DIST_SQR){ - if (nActive <= 3) return b2Polygon(); + if (nActive <= 3) { + // -- GODOT start -- + delete[] nodes; + // -- GODOT end -- + return b2Polygon(); + } //printf("Found dupe, %d left\n",nActive); --nActive; foundDupe = true; |